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:
parent
76c8418de5
commit
4f1d71027e
2 changed files with 9 additions and 12 deletions
|
@ -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) {
|
extern "C" void __declspec(dllexport) Init(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) {
|
||||||
hWndParent = hwndParent;
|
hWndParent = hwndParent;
|
||||||
|
|
||||||
|
if (!hwndParent) {
|
||||||
|
pushstring("can't find parent window");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SetImage(hwndParent, string_size, variables, stacktop);
|
SetImage(hwndParent, string_size, variables, stacktop);
|
||||||
|
|
||||||
WNDCLASSEX wc = {
|
WNDCLASSEX wc = {
|
||||||
|
@ -172,19 +177,11 @@ int myatoi(char *s)
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
|
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||||
if (hWndImage && hwnd != hWndImage) {
|
if (hWndImage && hwnd != hWndImage) {
|
||||||
|
if (message == WM_SIZE) {
|
||||||
|
ShowWindow(hWndImage, wParam == SIZE_MINIMIZED ? SW_HIDE : SW_SHOW);
|
||||||
|
}
|
||||||
if (message == WM_WINDOWPOSCHANGED) {
|
if (message == WM_WINDOWPOSCHANGED) {
|
||||||
LPWINDOWPOS wp = (LPWINDOWPOS) lParam;
|
SetWindowPos(hWndImage, hWndParent, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return CallWindowProc(
|
return CallWindowProc(
|
||||||
(long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))oldProc,
|
(long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))oldProc,
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue