My app is a Dialog box, created with DialogBoxParam. I want to temporarily disable it (when the user clicks a certain button) for a few seconds. I do that with (EnableWindow,hdlg,FALSE) and later reanable it. I would like to change the mouse cursor to the hourglass for the length of the operation. I do that. The cursor changes to what i want, but as soon as the mouse moves it goes back to the normal cursor. I tried capturing WM_MOUSEMOVE and changing the cursor to the hourglass, every time the message is received, but it seems to me that EnableWindow prevents from the dialog box to receive that message, so it doesn't affect the behaviour of the mouse in any way. (seen with SoftIce, WM_MOUSEMOVE is never sent as long as Dialog Box is disabled) Now i've already posted this problem and very few poor responses have been received. There's gotta be a way, guys, a very simple way, since i come across this thing in other programs very often. Thanks
Posted on 2001-01-12 20:44:00 by your mama
You might try changing the cursor in the window class, instead of using SetCursor: invoke SetClassLong,hWin,GCL_HCURSOR,hHourGlassCursor
Posted on 2001-01-12 20:52:00 by Racso
Each time the cursor needs to be redrawn--because the mouse has moved, because another window that was in front of your application has gone away, or because of whatever other reason--a WM_SETCURSOR event message is sent to your application. If you override the native behavior of your application on this event, the cursor you set remains unchanged until you change it again. You could do something like this... ... .IF uMsg==WM_SETCURSOR .IF cursorset==TRUE mov eax,TRUE ret .ELSE invoke DefWindowProc,hWnd,uMsg,wParam,lParam ret .ENDIF ... Just set 'cursorset' to TRUE when you manually change the cursor. Set it to FALSE when you're done and it should work.
Posted on 2001-01-13 02:47:00 by n0name