-
AdjustWindowRect
I want the client area to be 320 x 240.
Not the whole window.
Now, here is my code.
Code:
HWND WinClass::Create ( HINSTANCE hInstance, LPSTR class_name, LPSTR wnd_name, HWND parent,
DWORD dwStyle, int x, int y, int width, int height )
{
RECT rect = { 0, 0, width, height };
AdjustWindowRect ( &rect, dwStyle, true );
hWnd = CreateWindow ( class_name, wnd_name, dwStyle, x, y, width, height,
parent, NULL, hInstance, NULL );
return hWnd;
}
Isnt this the correct way to makesure your "client" area is the desired resolution? :confused:
-
You can always use the WM_NCCALCSIZE to change the client rect size.
-
You get the rect needed but don't use it.
>>CreateWindow ( class_name, wnd_name, dwStyle, x, y, width, height,
should be
CreateWindow ( class_name, wnd_name, dwStyle, rect.left, rect.top,rect.right-rect.left,rect.bottom-rect.top,
(as the top and left may not be zero)
edit
try
AdjustWindowRect(&rect, GetWindowLong(hWnd,GWL_STYLE), TRUE);