From 9f37ece5369fb5162233db5293e7db5a81d9af05 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 25 Nov 2006 10:51:00 +0000 Subject: [PATCH] size optimization git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4821 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 23ac4399..1db6c46c 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -1153,17 +1153,14 @@ int NSISCALL TreeGetSelectedSection(HWND tree, BOOL mouse) } static LONG oldTreeWndProc; +static LPARAM last_selected_tree_item; static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - static LPARAM last_item=-1; if (uMsg == WM_CHAR && wParam == VK_SPACE) { NotifyCurWnd(WM_TREEVIEW_KEYHACK); return 0; } #if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT) - if (uMsg == WM_DESTROY) { - last_item=-1; - } #ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE if (uMsg == WM_MOUSEMOVE) { if (IsWindowVisible(hwnd)) { @@ -1173,9 +1170,9 @@ static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l } #endif if (uMsg == WM_NOTIFY_SELCHANGE) { - if (last_item != lParam) + if (last_selected_tree_item != lParam) { - last_item = lParam; + last_selected_tree_item = lParam; mystrcpy(g_tmp, g_usrvars[0]); @@ -1212,6 +1209,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar hBMcheck1=LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_BITMAP1)); + last_selected_tree_item=-1; oldTreeWndProc=SetWindowLong(hwndTree1,GWL_WNDPROC,(long)newTreeWndProc); hImageList = ImageList_Create(16,16, ILC_COLOR32|ILC_MASK, 6, 0);