diff options
author | Neil <nyamatongwe@gmail.com> | 2020-04-05 08:43:27 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-04-05 08:43:27 +1000 |
commit | a7398db7f9a0f27c7a9e21d4a692d5c6d8ba3533 (patch) | |
tree | e0a5f4c77d10aac0bb98c428c164aafe2f810347 /win32/ScintillaWin.cxx | |
parent | 25cdcf3627343b1699833c2d8f5fbf76ba120bc2 (diff) | |
download | scintilla-mirror-a7398db7f9a0f27c7a9e21d4a692d5c6d8ba3533.tar.gz |
Feature [feature-requests:1345] Use more typesafe code to clear window pointers,
share implementation of window pointers between files, use GetWindowStyle.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index be485f051..90af4494b 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -144,14 +144,6 @@ namespace { const TCHAR callClassName[] = TEXT("CallTip"); -void *PointerFromWindow(HWND hWnd) noexcept { - return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0)); -} - -void SetWindowPointer(HWND hWnd, void *ptr) noexcept { - ::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr)); -} - void SetWindowID(HWND hWnd, int identifier) noexcept { ::SetWindowLongPtr(hWnd, GWLP_ID, identifier); } @@ -3367,7 +3359,7 @@ LRESULT PASCAL ScintillaWin::CTWndProc( } } else { if (iMessage == WM_NCDESTROY) { - ::SetWindowLong(hWnd, 0, 0); + SetWindowPointer(hWnd, nullptr); return ::DefWindowProc(hWnd, iMessage, wParam, lParam); } else if (iMessage == WM_PAINT) { PAINTSTRUCT ps; @@ -3490,7 +3482,7 @@ LRESULT PASCAL ScintillaWin::SWndProc( delete sci; } catch (...) { } - ::SetWindowLong(hWnd, 0, 0); + SetWindowPointer(hWnd, nullptr); return ::DefWindowProc(hWnd, iMessage, wParam, lParam); } else { return sci->WndProc(iMessage, wParam, lParam); |