DonationCoder.com Software > Post New Requests Here
DONE: Single Application Instance
RobC:
I am trying to prevent multiple instances of FireFox.
I tried with SingleInstance, but cannot get it to work (with FF).
Is there a trick as to what I should list in your Options Dialog ?
EG any of these ?
firefox
firefox.exe
C:\Program Files\Mozilla Firefox\firefox.exe
Thanks,
Rob
skwire:
Please try this bit of AHK code. I've written it as a shell hook that should only allow one instance of Firefox to exist.
--- Code: AutoIt ---Gui +LastFoundhWnd := WinExist()DllCall( "RegisterShellHookWindow", UInt, hWnd )MsgNum := DllCall( "RegisterWindowMessage", Str, "SHELLHOOK" )OnMessage( MsgNum, "ShellMessage" )DetectHiddenWindows, OnSetTitleMatchMode, 2 ShellMessage( wParam, lParam ){ WinGetClass, myClass, ahk_id %lParam% If ( wParam = 1 ) ; HSHELL_WINDOWCREATED { If ( InStr( myClass, "MozillaUIWindowClass" ) ) { WinGet, myList, List, ahk_class MozillaUIWindowClass If ( myList > 1 ) { WinClose, % "ahk_id " . lParam } } }}
RobC:
Thanks for that.
Could you advise what program to use to 'compile' it, and how to do it ?
Or, attach a compiled version.
Rob
srhamy:
http://www.autohotkey.com/
skwire:
Here you go. Source/binary download
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version