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 | bf9adaf7f82732929f00336421536812805cdf8c (patch) | |
| tree | 7f11a4a9808538d3bfe48b9b443b00de64756d98 /win32/ScintillaWin.cxx | |
| parent | f2878cb7710c1b5efda08cb0d5ca77acc0877339 (diff) | |
| download | scintilla-mirror-bf9adaf7f82732929f00336421536812805cdf8c.tar.gz | |
Backport: Feature [feature-requests:1345] Use more typesafe code to clear window pointers,
share implementation of window pointers between files, use GetWindowStyle.
Backport of changeset 8110:33f16ac2c3ca.
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 b34e0d96c..8c5e2bc0d 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -143,14 +143,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); } @@ -3435,7 +3427,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; @@ -3557,7 +3549,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); |
