now compatible with the minimize button

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2301 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-03-15 14:16:21 +00:00
parent 76c8418de5
commit 4f1d71027e
2 changed files with 9 additions and 12 deletions

View file

@ -21,6 +21,11 @@ extern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size,
extern "C" void __declspec(dllexport) Init(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) {
hWndParent = hwndParent;
if (!hwndParent) {
pushstring("can't find parent window");
return;
}
SetImage(hwndParent, string_size, variables, stacktop);
WNDCLASSEX wc = {
@ -172,19 +177,11 @@ int myatoi(char *s)
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
if (hWndImage && hwnd != hWndImage) {
if (message == WM_SIZE) {
ShowWindow(hWndImage, wParam == SIZE_MINIMIZED ? SW_HIDE : SW_SHOW);
}
if (message == WM_WINDOWPOSCHANGED) {
LPWINDOWPOS wp = (LPWINDOWPOS) lParam;
if (!(wp->flags & SWP_NOZORDER)) {
CallWindowProc(
(long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))oldProc,
hwnd,
message,
wParam,
lParam
);
SetWindowPos(hWndImage, hWndParent, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
return 0;
}
SetWindowPos(hWndImage, hWndParent, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
return CallWindowProc(
(long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))oldProc,