GetStartupInfo_ if clicked or keyed
Posted: Fri Jun 12, 2009 8:10 pm
Hi, i have small clenup utility which uses 'si\dwFlags & #STARTF_TITLESHORTCUT ' is there possibility to detect if the program was opened from StartMenu or with Keyboard 'Ctrl + Alt + F8' as it in both cases runs automatically (i have to set some parameters what to clean when opened from StartMenu), when opened with 'Ctrl + Alt + F8' to go automatic.
Code: Select all
; El_Choni: http://www.purebasic.fr/english/viewtopic.php?p=143028#143028
; Returns TRUE if started through a shortcut, FALSE if not.
#STARTF_TITLESHORTCUT = $800
Procedure StartedFromShortcut()
GetStartupInfo_(@si.STARTUPINFO)
If si\dwFlags & #STARTF_TITLESHORTCUT
ProcedureReturn #True
EndIf
ProcedureReturn #False
EndProcedure
MessageRequester("Started from shortcut?:", Str(StartedFromShortcut()))