How many pixels thick are the frame of my window (Win32)
-
I'm developing an animated-game on Win32. It runs only in windowed mode. I'm creating my window with the styles
WS_OVERLAPPED | WS_SYSMENU
so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user. We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that. The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ? -
I'm developing an animated-game on Win32. It runs only in windowed mode. I'm creating my window with the styles
WS_OVERLAPPED | WS_SYSMENU
so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user. We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that. The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ?Take a look at the
SystemParametersInfo
API function. -
I'm developing an animated-game on Win32. It runs only in windowed mode. I'm creating my window with the styles
WS_OVERLAPPED | WS_SYSMENU
so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user. We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that. The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ?Hanan888 wrote:
If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified
AFAIK the above is wrong. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Take a look at the
SystemParametersInfo
API function. -
Hanan888 wrote:
If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified
AFAIK the above is wrong. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeAs i said, the entire size is more than 800X600, so how can it fit into 800X600 screen ? some parts will be 'out of the screen'. I tried it now, don't look that horrible, actually. Maybe we'll just say, If you got a 800X600, it's your own problem... (in the About dialog) :)
-
As i said, the entire size is more than 800X600, so how can it fit into 800X600 screen ? some parts will be 'out of the screen'. I tried it now, don't look that horrible, actually. Maybe we'll just say, If you got a 800X600, it's your own problem... (in the About dialog) :)
If you set 800x600 on CreateWindow, then the overall size of the window (including borders) will be 800x600.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
If you set 800x600 on CreateWindow, then the overall size of the window (including borders) will be 800x600.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeI now realized thats correct. My Question should have actually been what should be the size of my background image so that it will fit. So I guess I'll figure out what the dimensions of the border and I'll reduce the dimensions of the background image by that. Thanks.
-
I now realized thats correct. My Question should have actually been what should be the size of my background image so that it will fit. So I guess I'll figure out what the dimensions of the border and I'll reduce the dimensions of the background image by that. Thanks.
GetClientRect
[^]. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
GetClientRect
[^]. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke