Posts: 2
Threads: 1
Joined: Aug 2004
Hello,
Ive been looking at this code for so long i cant see the wood for the trees. Anyone spot my simple mistake?
The macro is supposed to go: if window of type popup exists.... do this, else do this....
int h = win(571 460) //location of the popup
ifi win(h "" "" 8 ) // 8 flag code for must be popup
do this
else
do this
Any help would really help me out
Cheers
Andy
Posts: 12,087
Threads: 142
Joined: Dec 2002
First argument of win is window name, not handle (win itself returns window handle). Other syntax - win(x y).
If you have window handle and want to check whether it is popup, get window style and check for WS_POPUP flag.
[color=blue]int [/color]h = [color=blue]win[/color](571 460)
[color=blue]if[/color](GetWinStyle(h)&WS_POPUP)
,[color=blue]out [/color]"yes"
[color=blue]else[/color]
,[color=blue]out [/color]"no"
Posts: 2
Threads: 1
Joined: Aug 2004
When using this though the 'out' expects a string to follow rather than a variable to start the next task.
int h = win(571 460)
if(GetWinStyle(h)&WS_POPUP)
,,,,OUT lef 201 59 "Microsoft Excel - test.xls
,,,,'L Ce.........
Else
.....OUT lef 286 170 "UNI-work"......
is there a way of getting around this?
Thanks once again for your help
Andy
Posts: 12,087
Threads: 142
Joined: Dec 2002
Here out is only for example. Use it only to view what happens.
int h = win(571 460)
if(GetWinStyle(h)&WS_POPUP)
,lef 201 59 "Microsoft Excel - test.xls"
,'L Ce.........
else
,lef 286 170 "UNI-work"; ......
EXCELLENT!!!!
My only niggle now is that the repeat funtion at the top of my macro only runs on the 'else' option at the bottom of the script, If the if statment in the middle of the scriptis true it does not return to the top os the script to repeat again. Sure ill figure it eventually
Thanks for all your help!
Andy
EXCELLENT!!!!
My only niggle now is that the repeat funtion at the top of my macro only runs on the 'else' option at the bottom of the script, If the if statment in the middle of the scriptis true it does not return to the top os the script to repeat again. Sure ill figure it eventually
Thanks for all your help!
Andy