removed
Posted: 25 Feb 2018, 03:56
removed
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=44755
#SingleInstance : Determines whether a script is allowed to run again when it is already running.
#SingleInstance force|ignore|off
The word FORCE skips the dialog box and replaces the old instance automatically, which is similar in effect to the Reload command.
Yes. If suppose you have a script running and it sends P every time you click X, and you mistakely open that same script again. When you press P it sends out 2x X. Because there are two scripts.Yaosr wrote:so what is instance in that case? is instance = script ?
Code: Select all
#SingleInstance, off
OnMessage(0x5555, "MsgMonitor")
x:: ;one script to trigger them all
DetectHiddenWindows, On
WinGet, vWinList, List, % A_ScriptFullPath " - AutoHotkey v ahk_class AutoHotkey"
Loop, % vWinList
{
hWnd := vWinList%A_Index%
if !(hWnd = A_ScriptHwnd)
PostMessage, 0x5555,,,, % "ahk_id " hWnd
}
;MsgBox, % A_ScriptHwnd
MsgMonitor("", "", "", "")
return
MsgMonitor(wParam, lParam, uMsg, hWnd)
{
MsgBox, % A_ScriptHwnd
}
Code: Select all
#SingleInstance, off
~x:: ;triggered, not suppressed (open a script multiple times, the key press triggers the subroutine in each instance, however, the key press is not suppressed)
MsgBox, % A_ScriptHwnd
return