From 1768555f2bdaec2186d7277d61bfd3d5d7c5d008 Mon Sep 17 00:00:00 2001 From: anders_k Date: Tue, 17 Aug 2021 18:30:33 +0000 Subject: [PATCH] Just load the library git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7293 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/toolbar.cpp | 2 +- Contrib/Makensisw/update.cpp | 4 ++-- Contrib/Makensisw/utils.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Contrib/Makensisw/toolbar.cpp b/Contrib/Makensisw/toolbar.cpp index f55e4a74..18d0937c 100644 --- a/Contrib/Makensisw/toolbar.cpp +++ b/Contrib/Makensisw/toolbar.cpp @@ -87,7 +87,7 @@ static void LoadToolBarImages() HWND hTB = g_toolbar.hwnd; // Comctl32.dll version detection #ifndef _WIN64 - HMODULE hMod = GetModuleHandle(_T("comctl32.dll")); + HMODULE hMod = LoadSysLibrary("COMCTL32"); const FARPROC hasCC4_70 = (SupportsW95()) ? GetProcAddress(hMod, "InitCommonControlsEx") : (FARPROC) TRUE; // NT4 shipped with v4.70 const FARPROC hasCC4_71 = (SupportsWNT4() || SupportsW95()) ? GetProcAddress(hMod, "DllGetVersion") : (FARPROC) TRUE; // IE4 shipped with v4.71 #else diff --git a/Contrib/Makensisw/update.cpp b/Contrib/Makensisw/update.cpp index 82d48a83..7bbb861a 100644 --- a/Contrib/Makensisw/update.cpp +++ b/Contrib/Makensisw/update.cpp @@ -13,11 +13,11 @@ static LPSTR InetGetErrorStringAllocA(DWORD ec) DWORD flags = FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_IGNORE_INSERTS; if (FormatMessageA(flags|FORMAT_MESSAGE_FROM_SYSTEM, 0, ec, 0, (LPSTR) &buf, 0, 0)) return buf; - HMODULE hMod = GetModuleHandle(TEXT("WinInet")); + HMODULE hMod = LoadSysLibrary("WinInet"); if (hMod && FormatMessageA(flags|FORMAT_MESSAGE_FROM_HMODULE, hMod, ec, 0, (LPSTR) &buf, 0, 0)) return buf; #if 0 // We are not using WinHttp* functions - hMod = GetModuleHandle(TEXT("WinHTTP")); + hMod = LoadSysLibrary("WinHTTP"); if (hMod && FormatMessageA(flags|FORMAT_MESSAGE_FROM_HMODULE, hMod, ec, 0, (LPSTR) &buf, 0, 0)) return buf; #endif diff --git a/Contrib/Makensisw/utils.cpp b/Contrib/Makensisw/utils.cpp index 09009eda..5112c69c 100644 --- a/Contrib/Makensisw/utils.cpp +++ b/Contrib/Makensisw/utils.cpp @@ -713,11 +713,11 @@ void InitTooltips(HWND h) { InitCommonControlsEx(&icx); DWORD dwStyle = WS_POPUP | WS_BORDER | TTS_ALWAYSTIP; DWORD dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST; - g_tip.tip = CreateWindowEx(dwExStyle,TOOLTIPS_CLASS,NULL,dwStyle,0,0,0,0,h,NULL,GetModuleHandle(NULL),NULL); + g_tip.tip = CreateWindowEx(dwExStyle,TOOLTIPS_CLASS,NULL,dwStyle,0,0,0,0,h,NULL,HINST_APPLICATION,NULL); if (!g_tip.tip) return; g_tip.hook = SetWindowsHookEx(WH_GETMESSAGE,TipHookProc,NULL, GetCurrentThreadId()); AddTip(GetDlgItem(h,IDCANCEL),_T("Close MakeNSISW")); - AddTip(GetDlgItem(h,IDC_TEST),_T("Test the installer generated by MakeNSISW")); + AddTip(GetDlgItem(h,IDC_TEST),_T("Test the generated installer")); AddToolBarTooltips(); }