Jump to content
  • Advertisement
Sign in to follow this  
Jonus

How do i fix the size of my window?

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My programm uses the nehe framework. Well i guess it has to do with DefWindowProc(hWnd,uMsg,wParam,a);. Plz help.

Share this post


Link to post
Share on other sites
Advertisement
Can you give some more information? I know for a fact that the NeHe basecode works. Have you changed anything? What do you mean by 'fixing' the size?

Share this post


Link to post
Share on other sites
No. CreateWindow lets you specify the window size and position at creation, and SetWindowPos lets you do it for a preexisting window.

Share this post


Link to post
Share on other sites
Quote:
Original post by pi_equals_3
Can you give some more information? I know for a fact that the NeHe basecode works. Have you changed anything? What do you mean by 'fixing' the size?
I want that the window can't be resized.

Quote:
Original post by Fruny
No. CreateWindow lets you specify the window size and position at creation, and SetWindowPos lets you do it for a preexisting window.
I will check that Fruny.

Share this post


Link to post
Share on other sites
If you don't want the window to be resizeable, you'll have to specify that in CreateWindow or CreateWindowEx, in the dwstyle parameter.

You might want to post the exact way the basecode is calling CreateWindow, but my guess is that it's using WS_OVERLAPPEDWINDOW or WS_TILEDWINDOW. Those styles both contain several windows styles, including WS_THICKFRAME. WS_THICKFRAME is the style that allows your window to be resizeable by dragging the borders.

If it is using one of those, replace it with this.
WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME
That means, use an overlapped window style without the thick frame for resizing. If you also want to disable the maximize button, change it to this.
WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX

You can find information for CreateWindowEx here
and for CreateWindow here
And here is a page with window style information.

Share this post


Link to post
Share on other sites
Quote:
Original post by pi_equals_3
If you don't want the window to be resizeable, you'll have to specify that in CreateWindow or CreateWindowEx, in the dwstyle parameter.

You might want to post the exact way the basecode is calling CreateWindow, but my guess is that it's using WS_OVERLAPPEDWINDOW or WS_TILEDWINDOW. Those styles both contain several windows styles, including WS_THICKFRAME. WS_THICKFRAME is the style that allows your window to be resizeable by dragging the borders.

If it is using one of those, replace it with this.
WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME
That means, use an overlapped window style without the thick frame for resizing. If you also want to disable the maximize button, change it to this.
WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX

You can find information for CreateWindowEx here
and for CreateWindow here
And here is a page with window style information.
Perfect. Thanks, i don't know what i would do without you guys at gamedev.net.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!