I'm trying to make a script that avoid automatic sitting out while playing online poker. This presses "Sit in" button,even on windows not hilighted
Numpaddot:: WinGet, Output, List, ahk_class PTIODEVICE loop, %output% { SetFormat, Integer, d id := output%A_Index% WinGetPos,,, w, h, ahk_id %id% SetFormat, Integer, hex x := Round(xO * w) y := Round(yO * h) x += 0 y += 0 SetFormat, Float, 0.2 x := SubStr(x,3) count := 4 - StrLen(x) loop, %count% x := "0" . x y := SubStr(y,3) count := 4 - StrLen(y) loop, %count% y := "0" . y hexS := "0x" . y . x PostMessage, 0x201, 0x0001, %hexs%, , ahk_id %id% PostMessage, 0x202, 0x0001, %hexs%, , ahk_id %id% } Return
the problem is that this make the target windows steal focus from the previous one of the group.
Eg: I'm playing on two table while writing a letter to Silvio Berlusconi on notepad. I press the "Sit-in" hotkey. Notepad window remain on foreground,but I see that the other windows steal focus each other
Before:
1.notepad
2.poker A
3.poker B
After:
1.notepad
2.poker B
3.poker A
I need to avoit it! Whit Winspector Spy I can see that "WM_ACTIVATE" message is sent to the window that steal focus. How can I intercept this?
Thanks to anyone will help me!!