This topic is now archived and is closed to further replies.


Sizing the client area of a windowed app

Recommended Posts

MatrixCubed    199
This is mainly due to the fact that I can''t find any documentation on the subject, but is it possible to size the client area of a Win32 application so that it is considered the entire application''s area, even if it is clipped by the surrounding border? I checked the FAQ, and they had something close, but it doesn''t perform the way I want it to. My reason for wanting this, is that my D3D8 windowed renderer is inaccurate because for some reason the client area is downsized when the app is created. Any ideas? Thanks a million in advance! MatrixCubed

Share this post

Link to post
Share on other sites
Nytegard    839
Not quite sure what you mean, but why not just create a windowed app without a title bar or border, so you don''t have to worry about it?

Or just take the size of the title bar, menu, and border, and just subtract it out of the windowed rect? (borders, title bars, menu''s, etc do have a defined value somewhere, but I can''t remember exactly what it''s called).

Share this post

Link to post
Share on other sites
Orbitalx    122
Here's what I use :

DWORD style;
(m_FullScreen) ? style = WS_POPUP : style = WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX;

DebugOut("Creating %s application window.\n", m_FullScreen ? "Fullscreen" : "Windowed");
m_MainWindow = CreateWindowEx(0,
"CWinApp Application",
0, 0,
m_ClientWidth, m_ClientHeight,
NULL, NULL, m_Instance, &m_CallbackList);

if(m_MainWindow == NULL)
AssertM( (FALSE, "CWinApp::Init : CreateWindowEx() failed") );
return 0;

RECT rc1;
SetRect(&rc1, 0, 0, m_ClientWidth, m_ClientHeight);
AdjustWindowRectEx( &rc1, GetWindowLong(m_MainWindow, GWL_STYLE), FALSE, GetWindowLong(m_MainWindow, GWL_EXSTYLE));
MoveWindow(m_MainWindow, 0, 0, rc1.right - rc1.left, rc1.bottom -, FALSE);

have fun,


Edited by - Orbitalx on July 1, 2001 12:35:15 AM

Share this post

Link to post
Share on other sites
warm0ng3r    122
if ure asking what i think ure asking, use the WS_POPUP style flag, instead of whatever ure using (probably WS_OVERLAPPEDWINDOW which makes it look like a standard window).

*edit* never mind, i misread

here in castle camelot we eat ham and jam and spam alot!

Edited by - warm0ng3r on July 4, 2001 11:35:06 AM

Share this post

Link to post
Share on other sites