12-11-2007, 07:51 PM
Let the macro remembers button coordinates, waits until the dialog disappears, gets mouse coordinates, if they are where was button Yes, ...
int w1=WinC("Save changes" "Static" 0 "WordPad" "#32770")
act w1
Acc a=acc("Close" "PUSHBUTTON" w1 "" "" 0x1001) ;;X button on title bar
rep
,0.02
,if(!IsWindowVisible(w1)) break
,RECT ry rn rc rx
,GetWindowRect id(IDYES w1) &ry
,GetWindowRect id(IDNO w1) &rn
,GetWindowRect id(IDCANCEL w1) &rc
,a.Location(rx.left rx.top rx.right rx.bottom); rx.right+rx.left; rx.bottom+rx.top
,POINT p; xm p
if(PtInRect(&ry p.x p.y))
,out "Yes"
else if(PtInRect(&rn p.x p.y))
,out "No"
else if(PtInRect(&rc p.x p.y) or PtInRect(&rx p.x p.y))
,out "Cancel"
else
,out "probably closed using keyboard"
,