12-05-2016, 11:34 AM
Hi Gintaras,
In the macro below I get a Wait time out error despite the huge wait times and the fact that the window is already CA. (wait(2 WC w) does not change things)
Function Re_StartMIDI_OX
I have solved this by using a function instead of a wait, however I do not understand what the cause of the thrown error is.
Function WaitForWindowActive
In this function: I am unable to find how to insert 'windowName' in such a way that it is repaced by its content in the onscreen text string.
Is this possible at all ?
Regards,
GertC
In the macro below I get a Wait time out error despite the huge wait times and the fact that the window is already CA. (wait(2 WC w) does not change things)
Function Re_StartMIDI_OX
int w=win("MIDI-OX*" "MIDIOX:Frame" "" 0x1)
run "$program files$\MIDIOX\midiox.exe" "MIDIOX.ini" "" "C:\Users\GertAdmin\Documents\MIDI-OX\" ;;MIDI-OX
2
wait(2 w)
I have solved this by using a function instead of a wait, however I do not understand what the cause of the thrown error is.
Function WaitForWindowActive
function ~windowName
int w
int i=20
rep 20
,0.1 ;;20*0.1=2sec
,i=i-1
,w=win(windowName)
,if w
,,break
if i=0
,OnScreenDisplay "(windowName) not found" 1 800 350
ret i ;; if i=0 window not found
In this function: I am unable to find how to insert 'windowName' in such a way that it is repaced by its content in the onscreen text string.
Is this possible at all ?
Regards,
GertC