Date: 02-16-2022
Return to Index
created by gbSnippets
#Include "win32api.inc"
%STARTF_TITLESHORTCUT = 800 'Program was started through a shortcut. The lpTitle contains the shortcut path.
Function PBMain() As Long
? StartFileName
End Function
Function StartFileName() As String
Local StartupInformation As STARTUPINFO, sMessage As String
Function = "Not a shortcut"
StartupInformation.cb = SizeOf(StartupInformation)
GetStartupInfo(StartupInformation)
If StartupInformation.dwFlags And %STARTF_TITLESHORTCUT Then
If LCase$(Right$(StartupInformation.@lpTitle, 4)) = ".lnk" Then
Function = StartupInformation.@lpTitle
End If
End If
End Function
'gbs_01385
'Date: 10-17-2014
http://www.garybeene.com/sw/gbsnippets.htm