10-30-2006, 06:31 PM
Can use SetProp/GetProp.
spe -1
int w1
w1=win("Notepad")
out w1
SetProp(w1 "running" 1)
rep
if(!GetProp(w1 "running")) end
key "55"
wait 3
To stop from other function or toolbar, use
SetProp(hwnd "running" 0)
Here hwnd is Notepad handle. To get toolbar owner window handle in a toolbar or in a function called from a toolbar, use
int hwnd=GetWindow(TriggerWindow GW_OWNER)
For example, toolbar button code can be
Stop Func :SetProp(GetWindow(TriggerWindow GW_OWNER) "running" 0)
spe -1
int w1
w1=win("Notepad")
out w1
SetProp(w1 "running" 1)
rep
if(!GetProp(w1 "running")) end
key "55"
wait 3
To stop from other function or toolbar, use
SetProp(hwnd "running" 0)
Here hwnd is Notepad handle. To get toolbar owner window handle in a toolbar or in a function called from a toolbar, use
int hwnd=GetWindow(TriggerWindow GW_OWNER)
For example, toolbar button code can be
Stop Func :SetProp(GetWindow(TriggerWindow GW_OWNER) "running" 0)
