🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Wait Cursor Problem

Started by
11 comments, last by Matthew Allen 24 years, 5 months ago
I have written a Win32, DirectDraw 7, and DirectInpu 7 program that, for some reason, always displays the WAIT cursor while it''s running. I tried to set the cursor in the window class to the ARROW cursor, but it didn''t make any difference. I do ShowCursor(NULL) at the beginning of the game and ShowCursor(TRUE) later on, if that makes any difference in the way the cursor appears. Thanks for the help! - mallen22@concentric.net
- http://members.tripod.com/mxf_entertainment/
Advertisement
ShowCursor(FALSE);

not

ShowCursor(NULL);

I think it should be.
Then the cursor won''t be visible.
I WANT the cursor to be visible, but an arrow, not an hour glass. I guess I should have been more clear, sorry :)

NULL == FALSE == 0
NULL and FALSE are the same thing.

- mallen22@concentric.net
- http://members.tripod.com/mxf_entertainment/
That''s true. =)
Couple questions:

1) Are you sure you defaulted your wndclass cursor to arrow? (IDC_ARROW, rather than IDC_WAIT)

2) Are you changing your cursors anywhere at all? If you intend to change your cursor at any point in your program, your original cursor setting should be NULL in your wndclass, and then set to the original cursor you want immediately after. If you don't do this, then every time your mouse moves it will default back to the cursor you set in wndclass.

Edited by - felisandria on 1/3/00 5:15:47 PM
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
wc.hCursor = LoadCursor( hInstance, "IDC_ARROW" );
This is in the window class. It works the same without the quotes, too.

ShowCursor( NULL );
I do this after I make the window.

ShowCursor( TRUE );
I do this when I want to see the cursor.

These are the only things that I do that have to do with the cursor.



- Matthew Allen
- mallen22@concentric.net
- http://members.tripod.com/mxf_entertainment/
Try using
HCURSOR oldcursor = SetCursor(0);
to get rid of the cursor altogether and
SetCursor(oldcursor) when you want to use it again.
I''ve had a lot of problems hiding the mouse across different video drivers.

Here''s some info right from the VC++ help that may be useful:
"If your application must set the cursor while it is in a window, make sure the class cursor for the specified window''s class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved."

Hope some of this helps.


--Shannon Schlomer, BLAZE Technologies, Inc.
--Shannon Schlomer, BLAZE Technologies, Inc.
hi, i don''t know how to change the cursor, and obviously neither do the other people above, oh well good luck son....
You need to intercept the WM_SETCURSOR message and hide the cursor then:

switch(wparam) {
...
case WM_SETCUROSR: SetCursor(0); break;
}



Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
quote: for some reason, always displays the WAIT cursor while it''s running. I tried to set the cursor in the window class to the ARROW cursor, but it didn''t make any difference.


I don''t want to show my rear end here if I am missing something, but if I understand your post and what your trying to do, your problem is in your main window message dispatching system and/or your message cracker being handled incorrectly.

If you GetMessage/PeekMessage incorrectly and/or your messsage cracker is basically just a self contained loop to the extent it processes every function till a condition ends your program thus ending your loop that ultimately releases the "blocked thread" that is your program.

I''m willing to bet that when your program is running, as far as windows is concerned:

YourApplication: Not Responding...

is really all windows sees even though it''s not hosed, just too busy in an incorrectly designed loop in your program, etc.

This isn''t a slam on your design and/or abilities. Don''t treat it as such. It''s just a different angle than the other posts that this thread offer as a potential pitfall.

~deadlinegrunt

This topic is closed to new replies.

Advertisement