David MacCormack fixed a bug in window sizing with Windows menus
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40566
This commit is contained in:
parent
7ae540f3cc
commit
f8edfec204
1 changed files with 14 additions and 2 deletions
|
@ -396,6 +396,7 @@ LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
MINMAXINFO *info;
|
MINMAXINFO *info;
|
||||||
RECT size;
|
RECT size;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
int style;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
|
@ -424,8 +425,19 @@ LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
size.bottom = 0;
|
size.bottom = 0;
|
||||||
size.right = 0;
|
size.right = 0;
|
||||||
}
|
}
|
||||||
AdjustWindowRect(&size, GetWindowLong(hwnd, GWL_STYLE),
|
|
||||||
FALSE);
|
/* DJM - according to the docs for GetMenu(), the
|
||||||
|
return value is undefined if hwnd is a child window.
|
||||||
|
Aparently it's too difficult for MS to check
|
||||||
|
inside their function, so I have to do it here.
|
||||||
|
*/
|
||||||
|
style = GetWindowLong(hwnd, GWL_STYLE);
|
||||||
|
AdjustWindowRect(
|
||||||
|
&size,
|
||||||
|
style,
|
||||||
|
style & WS_CHILDWINDOW ? FALSE
|
||||||
|
: GetMenu(hwnd) != NULL);
|
||||||
|
|
||||||
width = size.right - size.left;
|
width = size.right - size.left;
|
||||||
height = size.bottom - size.top;
|
height = size.bottom - size.top;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue