Hello
@boiler
Thank you very much for pointing that out to me. Alas, still no luck. In my AHK-Skript, I generate some guis, among others a "main window". It seems like the code in the thread does not work, if the same skript generates two guis: the windows deactivate one another. The Gui does not deactivate another window, say Word, though. But I need one gui to not deactivate the other...
Here's my sample code:
Code: Select all
Gui, TestGui:New, +LastFound +AlwaysOnTop +ToolWindow -Caption -DPIscale +E0x08000000, TestGuiWindowName
Gui, TestGui:Margin , 2, 2
Gui, TestGui:Font, s12, Arial
Loop, 12
{
handlerFunction := Func("Button").Bind(A_Index) ; bind the filePath to the function to call when the button is pressed
Gui, TestGui:Add, Button, % "x" 5+(A_Index-1)*60 " y5 vF" A_Index " HWNDbuttonHwnd", F%A_Index%
GuiControl +g, %buttonHwnd%, %handlerFunction%
}
Gui, TestGui:Show, x100 y200 NoActivate, TestGuiWindowName
Sleep, 1000
Gui, TestGui:Font, bold
GuiControl, TestGui:Font, Button3
Gui, TestGui:Show, x200 y300 NoActivate, TestGuiWindowName
; second gui
Gui, AnotherGui:New, , Test
Gui, AnotherGui:Add, Text, ,some text
Gui, AnotherGui:Show
Return
Button(index) {
ToolTip % index
}
^Esc::
Reload
return
Clicking in the TestGUI deactivates the second gui "anotherGui"