Hello. I created this function to resize the window to the size of the screen every time it needs to. At first it would only work once. Now it just doesn't work at all? (I call it in the WM_PAINT instance)
PHP Code:
bool AdjustWindowRes(HWND hWnd)
{
bool value = true;
RECT RepaintRect;
GetWindowRect(hWnd,&RepaintRect);
int wWidth = RepaintRect.right - RepaintRect.left;
int wLength = RepaintRect.bottom - RepaintRect.top;
if (!wWidth == GetSystemMetrics(SM_CXSCREEN) || !wLength == GetSystemMetrics(SM_CYSCREEN))
{
MoveWindow(hWnd,0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN),SWP_NOMOVE);
}
GetWindowRect(hWnd,&RepaintRect);
wWidth = RepaintRect.right - RepaintRect.left;
wLength = RepaintRect.bottom - RepaintRect.top;
if (!wWidth == GetSystemMetrics(SM_CXSCREEN) || !wLength == GetSystemMetrics(SM_CYSCREEN))
value = false;
return value;
}
Ok, that format is a bit wierd.... anyways, I call this code in the PAINT thing:
PHP Code:
bool Checker = AdjustWindowRes(hWndMain);
if(!Checker)
Debugger<<"ERROR: Unable to resize window"<<endl;
It never returns false... but it doesn't work! I'm lost for ideas. You have any?