aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-05-19 15:32:06 +1000
committerNeil <nyamatongwe@gmail.com>2020-05-19 15:32:06 +1000
commit05498786fcc7fd6ef18be4b842df16769f4a29cd (patch)
treecfab70c3b0a28b0faddebca6046e1f87ab378b0a /win32/ScintillaWin.cxx
parent24b9ab288ebb48fb4cd7efc0fd6a409f50964664 (diff)
downloadscintilla-mirror-05498786fcc7fd6ef18be4b842df16769f4a29cd.tar.gz
Encapsulate GetProcAddress in a way that avoids undefined and conditionally
defined behaviour.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 9f6066cb9..01ffcbe76 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -527,11 +527,8 @@ void ScintillaWin::Init() {
hrOle = ::OleInitialize(nullptr);
// Find SetCoalescableTimer which is only available from Windows 8+
- HMODULE user32 = ::GetModuleHandle(TEXT("user32.dll"));
- if (user32) {
- SetCoalescableTimerFn = reinterpret_cast<SetCoalescableTimerSig>(
- ::GetProcAddress(user32, "SetCoalescableTimer"));
- }
+ HMODULE user32 = ::GetModuleHandleW(L"user32.dll");
+ SetCoalescableTimerFn = DLLFunction<SetCoalescableTimerSig>(user32, "SetCoalescableTimer");
vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourDesired(0, 0, 0xff));
vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourDesired(0, 0, 0xff));