Jump to content
  • Advertisement
Sign in to follow this  
Wixner

[Win32 API] AdjustWindowRectEx does not adjust WS_SYSMENU windows

This topic is 4454 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

Sorry for the long subject title, but I hate "plz help me!!1" topics. I think the topic is pretty straightforward, but I'll try to further explain my problem.
[source lang = "cpp" ]
Rect rcWindowRect = { 0, 0, 640, 480 };
AdjustWindowRectEx( &rcWindowRect, WS_OVERLAPPEDWINDOW, false, WS_EX_APPWINDOW );


The previous snippet of code adjusts my rcWindowRect to ( -23, -4, 644, 484 ), which are the proper value for a window client area of 640, 480. Sometimes I want my window to be of the WS_SYSMENU type, but the following code
[source lang = "cpp"]
Rect rcWindowRect = { 0, 0, 640, 480 };
AdjustWindowRectEx( &rcWindowRect, WS_SYSMENU, false, WS_EX_APPWINDOW );


does not adjust my rcWindowRect; it's still ( 0, 0, 640, 480 ). Can it be so that WM_SYSMENU alread has a client area of the created size and does not need to be adjusted?

Share this post


Link to post
Share on other sites
Advertisement
WS_SYSMENU is not legal on its own as a window style. It just indicates that the window has a menu on its title bar. You need to specify additional information.

In fact, to quote directly from MSDN:
"Creates a window that has a window menu on its title bar. The WS_CAPTION style must also be specified."

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!