Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

WinRunner script for Waitbusy?
> only need to load once, best in startup script or wherever load( getenv("M_ROOT") & "\lib\win32api", 1, 1 );
> returns 1 if app has busy cursor, 0 otherwise public function IsBusy(hwnd) {const HTCODE=33554433;
> 0x2000001 const WM_SETCURSOR=32;
return SendMessageLong(hwnd, WM_SETCURSOR, hwnd, HTCODE);
> wait for app to not be busy, optional timeout public function WaitBusy(hwnd, timeout) {const HTCODE=33554433;
> 0x2000001 const WM_SETCURSOR=32;
if(timeout) timeout *= 4;
while(--timeout)
{
if (SendMessageLong(hwnd, WM_SETCURSOR, hwnd, HTCODE) == 0) return E_OK;
wait(0,250);
> 1/4 second }
return -1;
> timeout error code }
> wait busy, provide window instead of hwnd public function WinWaitBusy(win, timeout){auto hwnd
; win_get_info(win, "handle", hwnd);
return WaitBusy(hwnd, timeout); }
> example of how to use it... set_window(win); WinWaitBusy(win); 
Posted By: Name:Rajesh Kr URL: WinRunner script for Waitbusy?