WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Change Cursor


Question:

Is there a way to set the mouse cursor from a pointer to an hourglass? Thanks.

Answer:

Usually the cursor is dependant on the application window the cursor is over. However you could try this dllcall code:
; Tested on Windows Xp Sp2

IDC_APPSTARTING = 32650
IDC_ARROW = 32512
IDC_CROSS = 32515
IDC_IBEAM = 32513
IDC_ICON = 32641
IDC_NO = 32648
IDC_SIZE = 32640
IDC_SIZEALL = 32646
IDC_SIZENESW = 32643
IDC_SIZENS = 32645
IDC_SIZENWSE = 32642
IDC_SIZEWE = 32644
IDC_UPARROW = 32516
IDC_WAIT = 32514

IDC_APPSTARTING = 32650
OCR_NORMAL = 32512
hcursor = DllCall( DirWindows(1):"USER32.DLL", long:"LoadCursorA" , long: 0, long:IDC_APPSTARTING)
retval = DllCall( DirWindows(1):"USER32.DLL", long:"SetSystemCursor" , long: hcursor, long:OCR_NORMAL)

TimeDelay(10)

hcursor = DllCall( DirWindows(1):"USER32.DLL", long:"LoadCursorA" , long: 0, long:IDC_APPSTARTING)
retval = DllCall( DirWindows(1):"USER32.DLL", long:"SetSystemCursor" , long: hcursor, long:OCR_NORMAL)
Exit

Article ID:   W17414
File Created: 2008:04:10:15:09:40
Last Updated: 2008:04:10:15:09:40