I have problems activating a window.
Sometimes it works and sometimes not.
By activate I mean that the window opens and appears at the front of the screen.
An excerpt from the program .:
examples of values .:
- aWin.artID = Header ahk_exe Pvxwin32.exe ahk_class #109
- aWin.ID = ahk_exe Pvxwin32.exe ahk_class #109
- aWin.hwnd = 0xe1522
- runTimeLeft = 0 to 3
Code: Select all
...
aWin.hwnd := WinExist(aWin.artID)
if aWin.hwnd
{ WinActivate % aWin.ID
WinWaitActive % aWin.ID,, % runTimeLeft
if ErrorLevel
...
Don't think it's a problem to identify the program with aWin.hwnd
My wish is to first check if the exe program is started (or not) - It seems to work fine
If the EXE program is run, it must be opened in a predetermined size and placed in the desired location.
The problem is that the EXE program is not always placed at the front of the screen.
Experience that it works worse if the exe program is minimized before running this script.
Where am I doing wrong?