Thats wierd. It compiled and worked fine for me.
I am able to move, resize, etc. and also have a normal cursor.
Win32 Window Issue (C++)
[quote name='ryan20fun' timestamp='1307044277' post='4818815']
[quote name='Endurion' timestamp='1307039681' post='4818789']
You need to set a valid class cursor in your WNDCLASS. If you set it to NULL (which you do) Windows displays the busy cursor.
that is not correct, from personel experiance.
it uses the default windows arrow.
[/quote]
No it doesn't. It doesn't display the busy cursor either. It simply doesn't change it.
If the cursor member of the window class is set to NULL, and the application doesn't take charge of setting the mouse cursor itself (for example, in the window's message processor procedure in response to WM_SETCURSOR), then the operating system will not set the cursor for you. What this means is the cursor will remain the same as it was before it entered the window's client area. That's why if you move the cursor to the outer frame of the window as if you want to resize it, then bring it back inside the client area, the cursor will still look like the "sizing" cursor. Note that the default window procedure handles setting the cursor when the mouse is in the non-client area.
In fact, the default window procedure's response to WM_SETCURSOR is to set the cursor to whatever it is that is assigned to the hCursor member of the window class structure.
[/quote]
thants what i ment
OK, so I figured I would give you guys an update. Since I was writing this post away from my dev machine I was 100% certain I had tried it as the code I posted. Apparently I was wrong, sorry about that. I should verify what I am doing before I claim I am doing it in the future.
I had left in code to initialize raw input. Apparently setting up a raw input device with RIDEV_NOLEGACY caused the issue I was having. As soon as I removed that flag when creating my raw input devices everything cleared up.
I had left in code to initialize raw input. Apparently setting up a raw input device with RIDEV_NOLEGACY caused the issue I was having. As soon as I removed that flag when creating my raw input devices everything cleared up.
If you want to stick to using raw win32 window handling, I would download WTL off sourceforge and use that, it takes care of a lot of the boilerplate stuff out of the box and is very customizable, and is pretty much straight to the metal as far as frameworks go (all templates, no virtual sillyness). Ideal for a simple game imo.
Otherwise a larger framework (Qt, wxWidgets, MFC) can be made to work but is a lot more work (though they have much better documentation & samples).
Otherwise a larger framework (Qt, wxWidgets, MFC) can be made to work but is a lot more work (though they have much better documentation & samples).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement