Fixed stuck up windows on Windows 98

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2724 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-07-16 20:31:51 +00:00
parent 7d6958e253
commit a0a7ca8a09
2 changed files with 15 additions and 13 deletions

View file

@ -31,7 +31,7 @@ enum {
MIL_BITMAP, MIL_BITMAP,
MIL_TRANSPARENT_BITMAP, MIL_TRANSPARENT_BITMAP,
MIL_TEXT MIL_TEXT
}; } ObjType;
struct myImageList { struct myImageList {
BYTE iType; BYTE iType;
@ -298,8 +298,6 @@ NSISFunc(Redraw) {
NSISFunc(Clear) { NSISFunc(Clear) {
ECS(); ECS();
BOOL bIsFirst = TRUE;
myImageList *img = &bgBitmap; myImageList *img = &bgBitmap;
while (img) { while (img) {
switch (img->iType) { switch (img->iType) {
@ -315,21 +313,21 @@ NSISFunc(Clear) {
myImageList *thisImg = img; myImageList *thisImg = img;
img = img->next; img = img->next;
thisImg->next = NULL;
if (!bIsFirst) if (thisImg != &bgBitmap)
GlobalFree(thisImg); GlobalFree(thisImg);
else
bIsFirst = FALSE;
} }
bgBitmap.next = 0;
bgBitmap.bReady = FALSE; bgBitmap.bReady = FALSE;
LCS(); LCS();
} }
NSISFunc(Destroy) { NSISFunc(Destroy) {
SetWindowLong(hWndParent, GWL_WNDPROC, (long)oldProc); bgBitmap.bReady = FALSE;
if (IsWindow(hwndParent))
SetWindowLong(hwndParent, GWL_WNDPROC, (long)oldProc);
SendMessage(hWndImage, WM_CLOSE, 0, 0); SendMessage(hWndImage, WM_CLOSE, 0, 0);
hWndImage = 0; hWndImage = 0;
Clear(0, 0, 0, 0); Clear(0, 0, 0, 0);
@ -342,7 +340,8 @@ NSISFunc(Sound) {
char szStop[] = {'/', 'S', 'T', 'O', 'P', 0}; char szStop[] = {'/', 'S', 'T', 'O', 'P', 0};
DWORD flags = SND_FILENAME | SND_NODEFAULT; DWORD flags = SND_FILENAME | SND_NODEFAULT;
g_stacktop=stacktop;
g_stacktop = stacktop;
popstring(szTemp); popstring(szTemp);
if (lstrcmpi(szTemp, szWait)) if (lstrcmpi(szTemp, szWait))
flags |= SND_ASYNC; flags |= SND_ASYNC;
@ -356,12 +355,14 @@ NSISFunc(Sound) {
} }
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
if (hwnd == hWndParent) { HWND hwndParent = hWndParent;
if (hwnd == hwndParent) {
if (message == WM_SIZE) { if (message == WM_SIZE) {
ShowWindow(hWndImage, wParam == SIZE_MINIMIZED ? SW_HIDE : SW_SHOW); ShowWindow(hWndImage, wParam == SIZE_MINIMIZED ? SW_HIDE : SW_SHOW);
} }
if (message == WM_WINDOWPOSCHANGED) { if (message == WM_WINDOWPOSCHANGED) {
SetWindowPos(hWndImage, hWndParent, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); SetWindowPos(hWndImage, hwndParent, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
} }
return CallWindowProc( return CallWindowProc(
(long (__stdcall *)(HWND,unsigned int,unsigned int,long))oldProc, (long (__stdcall *)(HWND,unsigned int,unsigned int,long))oldProc,
@ -534,12 +535,13 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
break; break;
case WM_WINDOWPOSCHANGING: case WM_WINDOWPOSCHANGING:
if (IsWindow(hwndParent))
{ {
LPWINDOWPOS wp = (LPWINDOWPOS) lParam; LPWINDOWPOS wp = (LPWINDOWPOS) lParam;
wp->flags |= SWP_NOACTIVATE; wp->flags |= SWP_NOACTIVATE;
wp->hwndInsertAfter = hWndParent; wp->hwndInsertAfter = hwndParent;
break;
} }
break;
case WM_CLOSE: case WM_CLOSE:
DestroyWindow(hwnd); DestroyWindow(hwnd);
break; break;

Binary file not shown.