Is there a better way of doing this ?
When I have Sap Business One started, and fire below code, the Send {F2} and Send {F5} only
works when I use WinActivate, otherwise the focus is on the gui.
Just curious, it works like I want but I was just wondering if there was another way.
Code: Select all
SetTitleMatchMode, 2 ;
Gui, +AlwaysOnTop
Gui, Add, Button, x86 y67 w100 h30 , F2
Gui, Add, Button, x196 y67 w100 h30 , F5
; Generated using SmartGUI Creator for SciTE
Gui, Show, w477 h377, Toetsenbord
return
ButtonF2:
{
WinActivate, - SRT International BV, , 3
Send {F2}
return
}
ButtonF5:
{
WinActivate, - SRT International BV, , 3
Send {F5}
return
}
GuiClose:
ExitApp