I want to make my mouse pointer disappear by calling function invoke ShowCursor,NULL I want to show it again by calling function invoke ShowCursor,1 but this is only valid in our window so how can we show or hide our mouse pointer every where in arbitrary position in our monitor ? anybody knows ? how can we show cursor in our dialog and disapear when we make our mouse pointer out of our dialog box. if we hook the mouse or maybe any simple trick to do that ? all response will be appreciated
Posted on 2001-03-23 05:30:00 by newbies
You could make sure the cursor cannot leave your window, use ClipCursor and an appropriate RECT. This won't stop the user ALT-TABing to another window though, or minimising the current window etc. Mirno
Posted on 2001-03-23 05:44:00 by Mirno
It makes for poor interface design to turn the mouse cursor off. One needs to see it, to get it back in the box. IF your program bombs while the cursor is off, what restores normal function?
Posted on 2001-03-23 07:00:00 by SFinegan
I follow as Mirno said by using ClipCursor but we must arrange our rectangle area that is because mydialog box for the first time must be in the center in our screen so we must arrange the rectangle area surround it. It was worked but with inconvenient condition. i try with windows 2000 the mouse pointer is valid to the area we are choosen but after we click the dialog box the rectangle area surround dialog box was not valid again. my mouse pointer can go anywhere after we clicked dialog box. This effect was different if we try it in windows 95. In windows 95 is ok but i could not handle if user press CTRL+ALT+DEL. After CTRL+ALT+DEL was pressed the rectangle area surround dialog box would be invalid. I have hooked keyboard by setting the hook with WH_JOURNALRECORD but still don't know why to make ALT+TAB or CTRL+ALT+DEL to be mulfuntion. does anybody know how to correct this problem ?
Posted on 2001-03-27 00:12:00 by newbies
oh what a laugh I have just had, I lost my mouse cursor completely!!! ok, first a Warning: This affects the whole system, even when the app exits, it will still take effect!!!! Now thats over, here's how to disable your cursor (well make it invisible anyway)

invoke LoadCursor,hInstance,IDC_MYCURSOR
invoke SetSystemCursor,eax,
This will change any of the systems cursors to IDC_MYCURSOR - but which cursor do you have to change? Well you choose is one of the values below, they weren't in my windows.inc file, they might be in yours....

OCR_NORMAL         equ 32512 ; your normal cursor
OCR_IBEAM          equ 32513 ; the text editing one
OCR_WAIT           equ 32514 ; hourglass
OCR_CROSS          equ 32515 ; another of the default ones like a plus sign +
OCR_UP             equ 32516 ; an up arrow, big thick one, ugly sucker
OCR_SIZENWSE       equ 32642 ; diagonal sizing arrow
OCR_SIZENESW       equ 32643 ; ditto
OCR_SIZEWE         equ 32644 ; horizontal sizing arrow
OCR_SIZENS         equ 32645 ; the vertical one
OCR_SIZEALL        equ 32646 ; both of the above to combined
OCR_NO             equ 32648 ; the O with a slash (no drop)
OCR_HAND           equ 32649 ; new windows one
OCR_APPSTARTING    equ 32650 ; pointer and hourglass one.
Faults with this:- If the use moves the cursor over another window with a custom cursor, then it will show up. To stop this clip the cursor to your window. If you program crashes good luck finding your mouse! On the last point, I would write a program which restores all the cursors before writing one which gets rid of them. then when you program goes pair-shaped, you can recover your cursors! good luck... you have been warned... Umbongo
Posted on 2001-03-27 07:56:00 by umbongo
Hi Umbongo, thank's a lot with your cursor info :-> but i am not yet try your cursor, may be later. I still try ClipCursor as Mirno Suggested. It was good to constrain my mouse pointer surround my dialog box. But there was a weakness that when we clicked on the dialog box (on the caption precisely) and then dragged it, My rectangle area that contrained that mouse pointer was not valid again so my mouse pointer can go anywhere. To handle this problem we must remove my dialog style to be without caption and it is ok but my window looks badly :-<. So the only way i guess we must to handle how my dialog box or window with caption to be can not be dragged but i still don't know to do that ( i try this in windows 2000).
Posted on 2001-03-27 19:51:00 by newbies