diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index e838da9a..d4ff5d00 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -366,6 +366,7 @@ end: // Clean up after plug-ins if (plugins_temp_dir[0]) doRMDir(plugins_temp_dir,1); #endif // NSIS_CONFIG_PLUGIN_SUPPORT + if (g_hIcon) DeleteObject(g_hIcon); ExitProcess(ret); } diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index b7ec047d..3427ec2b 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -38,6 +38,7 @@ #define LB_ICONWIDTH 20 #define LB_ICONHEIGHT 20 +HICON g_hIcon; static char gDontFookWithFocus = 0; // Added by Amir Szekely 3rd August 2002 @@ -360,6 +361,7 @@ int NSISCALL ui_doinstall(void) if (!g_inst_cmnheader->silent_install) #endif//NSIS_CONFIG_SILENT_SUPPORT { + g_hIcon=LoadIcon(g_hInstance,MAKEINTRESOURCE(IDI_ICON2)); m_bgwnd=GetDesktopWindow(); #ifdef NSIS_SUPPORT_BGBG if (g_inst_cmnheader->bg_color1 != -1) @@ -442,8 +444,6 @@ static int CALLBACK WINAPI BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lPar BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - static HICON hIcon; - if (uMsg == WM_DESTROY && hIcon) { DeleteObject(hIcon); hIcon=0; } if (uMsg == WM_INITDIALOG || uMsg == WM_NOTIFY_OUTER_NEXT) { int iscp=0,islp=0,isdp=0,ispotentiallydp=0; @@ -480,8 +480,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) m_hwndOK=GetDlgItem(hwndDlg,IDOK); m_hwndCancel=GetDlgItem(hwndDlg,IDCANCEL); SetDlgItemTextFromLang(hwndDlg,IDC_VERSTR,LANGID_BRANDING); - hIcon=LoadIcon(g_hInstance,MAKEINTRESOURCE(IDI_ICON2)); - SetClassLong(hwndDlg,GCL_HICON,(long)hIcon); + SetClassLong(hwndDlg,GCL_HICON,(long)g_hIcon); SetDlgItemTextFromLang(hwndDlg,IDCANCEL,LANGID_BTN_CANCEL); #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT if (!g_is_uninstaller) diff --git a/Source/exehead/bgbg.c b/Source/exehead/bgbg.c index 9f7caa52..b920cc85 100644 --- a/Source/exehead/bgbg.c +++ b/Source/exehead/bgbg.c @@ -73,10 +73,9 @@ HWND NSISCALL bgWnd_Init() { RECT vp; static WNDCLASS wc; - wc.style = CS_VREDRAW | CS_HREDRAW; wc.lpfnWndProc = BG_WndProc; wc.hInstance = g_hInstance; - wc.hIcon = LoadIcon(g_hInstance,MAKEINTRESOURCE(IDI_ICON2)); + wc.hIcon = g_hIcon; wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.lpszClassName = "_Nb"; diff --git a/Source/exehead/state.h b/Source/exehead/state.h index 0022f580..1a2486a6 100644 --- a/Source/exehead/state.h +++ b/Source/exehead/state.h @@ -12,3 +12,4 @@ extern HWND g_hwnd; extern int g_filehdrsize; extern HANDLE g_hInstance; extern HWND insthwnd,insthwndbutton; +extern HICON g_hIcon; \ No newline at end of file