Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wait(2 w) and window not found
#1
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
Code:
Copy      Help
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
Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)