ERFORDERLICHE
OBJEKTE
1 Commandbutton (Command1)
FORM-CODE
Private Declare Function GetShortPathName Lib "kernel32" Alias _
"GetShortPathNameA" (ByVal lpszLongPath As String, ByVal _
lpszShortPath As String, ByVal lBuffer As Long) As Long
Private Function GetShortPath(Dateiname As String) As String
Dim l As Long
Dim s As String
s = String$(165, 0)
l = GetShortPathName(Dateiname, s, 164)
If l = 0 Then
GetShortPath = Dateiname
Else
GetShortPath = Left$(s, l)
End If
End Function
Private Sub Command1_Click()
Dim s As String
s = App.Path
If Right(s, 1) <> "\" Then s = s & "\"
s = s & App.EXEName
s = GetShortPath(s)
MsgBox s
End Sub
|