Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; check ob laufender firefox.exe prozess existiert
- If ProcessExists( "firefox.exe" ) Then
- ; existiert bereits, pr�fen ob fester oder portabler l�uft
- $laufender_prozess = _ProcessGetLocation( "firefox.exe" )
- If $laufender_prozess <> @ScriptDir & "\Firefox\firefox.exe" Then
- #cs
- wenn laufender firefox prozess nicht von der portablen version ist,
- dann starte firefox mit -no-remote und -profile, andernfalls mache nichts.
- fest laufender firefox nimmt externe links an.
- #ce
- Run( "Firefox\firefox.exe -no-remote -profile Profilordner" )
- EndIf
- Else
- ; existiert nicht, firefox starten mit -profile. portabler Firefox nimmt links an
- Run( "Firefox\firefox.exe -profile Profilordner" )
- EndIf
- ; Pfad zu einem Prozess auslesen
- Func _ProcessGetLocation($sProc = @ScriptFullPath)
- Local $iPID = ProcessExists($sProc)
- If $iPID = 0 Then Return SetError(1, 0, -1)
- Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
- If $aProc[0] = 0 Then Return SetError(1, 0, -1)
- Local $vStruct = DllStructCreate('int[1024]')
- DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int*', 0)
- Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
- If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '')
- Return $aReturn[3]
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement