Sometimes, you can only tell when an AUT operation has ended by checking the windows mouse cursor - is it an hourglass, or a simple arrow.
The following code allows your to get the integer code of the mouse icon:
'These come once, in the top of the script
extern.Declare micLong,"GetForegroundWindow","user32.dll","GetForegroundWindow"
extern.Declare micLong,"AttachThreadInput","user32.dll","AttachThreadInput", micLong, micLong,micLong
extern.Declare micLong,"GetWindowThreadProcessId","user32.dll","GetWindowThreadProcessId", micLong, micLong
extern.Declare micLong,"GetCurrentThreadId","kernel32.dll","GetCurrentThreadId"
extern.Declare micLong,"GetCursor","user32.dll","GetCursor"
'Function definition
function get_cursor()
hwnd = extern.GetForegroundWindow()
pid = extern.GetWindowThreadProcessId(hWnd, NULL)
thread_id=extern.GetCurrentThreadId()
extern.AttachThreadInput pid,thread_id,True
get_cursor=extern.GetCursor()
extern.AttachThreadInput pid,thread_id,False
end function
'Now we can use the function in our scripts
Print get_cursor()
Posted in Keyboard and Mouse


Yaron Assa




April 16th, 2008 at 7:39 am
i have a doubt…
i need to just move the mouse after each say 3 min when a prog is getting run…
basically i would like to avoid my sys to get locked…
can you help me….
is there any other way so that i can handle pop-up even if my sys gets locked
April 22nd, 2008 at 8:21 am
change your registry values to disable the screen saver.
to do so, run this:
Const HKEY_CURRENT_USER = &H80000001
strComputer = “.”
‘Create Key
Set oReg=GetObject(”winmgmts:{impersonationLevel=impersonate}!\\” & _
strComputer & “\root\default:StdRegProv”)
strKeyPath = “Software\Policies\Microsoft\Windows\Control Panel\Desktop”
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath
‘Create String
Set oReg=GetObject(”winmgmts:{impersonationLevel=impersonate}!\\” & _
strComputer & “\root\default:StdRegProv”)
strSSActiveNameValue = “ScreenSaveActive”
strSSActiveValue = “0″
strSSIsSecureNameValue = “ScreenSaverIsSecure”
strSSIsSecureValue = “0″
strSSTimeOutNameValue = “ScreenSaveTimeOut”
strSSTimeOutValue = “0″
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strSSActiveNameValue,strSSActiveValue
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strSSIsSecureNameValue,strSSIsSecureValue
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strSSTimeOutNameValue,strSSTimeOutValue
April 22nd, 2008 at 8:24 am
What is the integer for the hour glass?
July 18th, 2008 at 4:33 pm
I’ve a question here… What is the integer value for the different states of the cursor?
For eg: I want the state of the cursor, in which i can drag a part in the window… Thanks in advance
July 19th, 2008 at 11:43 am
The integer represent the code id of the cursor