Fixed resize bug.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3400 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
6206755ccf
commit
fb4683b51b
2 changed files with 17 additions and 6 deletions
|
@ -749,6 +749,11 @@ BOOL CALLBACK DialogResize(HWND hWnd, LPARAM /* unused */)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
RECT r2;
|
||||
GetWindowRect(g_toolbar.hwnd, &r2);
|
||||
SetWindowPos(hWnd, 0, 0, 0, r.right - r.left + g_resize.dx, r2.bottom-r2.top, SWP_NOMOVE|SWP_NOZORDER);
|
||||
}
|
||||
RedrawWindow(hWnd,NULL,NULL,RDW_INVALIDATE);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -305,24 +305,30 @@ void RestoreWindowPos(HWND hwnd) {
|
|||
DWORD t;
|
||||
if ((RegQueryValueEx(hKey,REGLOC,NULL,&t,(unsigned char*)&p,&l)==ERROR_SUCCESS)&&(t == REG_BINARY)&&(l==sizeof(p))) {
|
||||
int width, height;
|
||||
int windowWidth, windowHeight;
|
||||
|
||||
width = GetSystemMetrics(SM_CXFULLSCREEN);
|
||||
height = GetSystemMetrics(SM_CYFULLSCREEN);
|
||||
height += GetSystemMetrics(SM_CYCAPTION);
|
||||
if((p.rcNormalPosition.right-p.rcNormalPosition.left) > width) {
|
||||
windowWidth = p.rcNormalPosition.right-p.rcNormalPosition.left;
|
||||
if(windowWidth > width) {
|
||||
p.rcNormalPosition.left = 0;
|
||||
p.rcNormalPosition.right = width;
|
||||
}
|
||||
else if(p.rcNormalPosition.right > width) {
|
||||
p.rcNormalPosition.left = (width - (p.rcNormalPosition.right-p.rcNormalPosition.left))/2;
|
||||
else if(p.rcNormalPosition.right > width || p.rcNormalPosition.left < 0) {
|
||||
p.rcNormalPosition.left = (width - windowWidth)/2;
|
||||
p.rcNormalPosition.right = p.rcNormalPosition.left + windowWidth;
|
||||
}
|
||||
|
||||
if((p.rcNormalPosition.bottom-p.rcNormalPosition.top) > height) {
|
||||
windowHeight = p.rcNormalPosition.bottom-p.rcNormalPosition.top;
|
||||
if(windowHeight > height) {
|
||||
p.rcNormalPosition.top = 0;
|
||||
p.rcNormalPosition.bottom = height;
|
||||
}
|
||||
else if(p.rcNormalPosition.bottom > height) {
|
||||
p.rcNormalPosition.top = (height - (p.rcNormalPosition.bottom-p.rcNormalPosition.top))/2;
|
||||
else if(p.rcNormalPosition.bottom > height || p.rcNormalPosition.top < 0) {
|
||||
|
||||
p.rcNormalPosition.top = (height - windowHeight)/2;
|
||||
p.rcNormalPosition.bottom = p.rcNormalPosition.top + windowHeight;
|
||||
}
|
||||
|
||||
p.length = sizeof(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue