Skip to main content
GameDev.net gamedev.net
🔒 Locked

Window Styles and Mouse Input

Started by glVertex3f Jun 24, 2004 at 11:52 PM 7 replies 2.6k views
Original Post
glVertex3f
glVertex3f
I am making a Map Editor, which is coming on suprisingly well... Two Questions... 1) I have a 640 x 480 window... I want to know how to disable resizing that window, and disable just the Maximize button 2) I am using this...

case WM_MOUSEMOVE:
  bMB = wParam;
  MouseX = LOWORD(lParam);
  MouseY = HIWORD(lParam);
break;
This only detects a mouse "click" if the mouse is moving.. And it seems a bit sluggish or delayed... Any other way to do this?
Nervo
Nervo
Hello.

For question 1 try doing a bitwise 'OR' combination of:

WS_OVERLAPPED and WS_MINIMIZEBOX in CreateWindow() as the third argument.

If I get time I'll try to address question 2 soon.

EDIT: looking over the second part, I'm a bit confused as to what you are trying to accomplish. Your code is trapping the mousemove message but you seem to be asking about detecting mouse clicks. Perhaps I'm not understanding you correctly.
Well, R2D22U2..
Colin Jeanne
Colin Jeanne
1. Dont create the window using thw WS_THICKFRAME or WS_SIZEBOX styles to disallow resizing the window. To disable the maximize box dont specify the WS_MAXIMIZEBOX style.
glVertex3f
glVertex3f
For the mouse thing...
That code only detects the click if the mouse is moving.. if the mouse is still... it doesnt detect it.

And I used

WS_OVERLAPPEDWINDOW

I tried WS_OVERLAP | WM_MINIMIZEBOX but there were no buttons there at all.
Nervo
Nervo
Quote:
Original post by glVertex3f

I tried WS_OVERLAP | WM_MINIMIZEBOX but there were no buttons there at all.


Hmm, looking at some of my recent code, when I specified WS_SYSMENU in addition to the other two, it worked fine. Try that, and if I find something else I'll post again.
Well, R2D22U2..
glVertex3f
glVertex3f
Problem one solved :-)

edit: Found out about the mouse thing...

case WM_LBUTTONDOWN:
blah
break;

Thank you!
Nervo
Nervo
WM_MOUSEMOVE will only fire when there are actual mouse movements, and should have nothing to do with clicks. You can however, find out if a mouse button was pressed when the WM_MOUSEMOVE event was fired because it will have been passed into wParam.

If you wanted to find out if a mouse button is pressed, for instance the left mouse button, then trap this event:

WM_LBUTTONDOWN

lParam will contain the x and y positions of the pointer when the event was fired if you need to know this. If you have further questions feel free to ask.

EDIT: Whoops, it seems you realized it already.
Well, R2D22U2..
glVertex3f
glVertex3f
Yup :-)

I am extremely new to the whol Windows Programming thing. I started about one month ago when I started learning OpenGL.

Anyway this map editor should be neat.. I just implemented saving and loading the map file.

This should be a nice tool for rpgs/side scrollers!

EDIT:
Any ideas where I could find a good tutorial or examples of the "open" dialog box and some other thigs (Like little floating dialog boxes that let you choose tools/textures)
PinguinDude
PinguinDude
http://winprog.org/tutorial/
http://sourceforge.net/projects/pingux/ <-- you know you wanna see my 2D Engine which supports DirectX and OpenGL or insert your renderer here :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.