aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-30 09:52:22 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-30 09:52:22 +1000
commitff4df3c1fdd728ce6d3b43c607c743814dd974e1 (patch)
tree61e378eb87766e938d041478f03c32ab6e197bad /win32/PlatWin.cxx
parent3385ec0a828806e7711eb277ac6b3a1a8ed70f6b (diff)
downloadscintilla-mirror-ff4df3c1fdd728ce6d3b43c607c743814dd974e1.tar.gz
Backport: Use message parameter access macros provided by Windows instead of casting.
Backport of changeset 6762:addd3229350b.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 3e6b02438..e1acdb125 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -688,9 +688,8 @@ void SurfaceGDI::BrushColor(ColourDesired back) {
// Only ever want pure, non-dithered brushes
const ColourDesired colourNearest = ColourDesired(::GetNearestColor(hdc, back.AsLong()));
brush = ::CreateSolidBrush(colourNearest.AsLong());
- brushOld = static_cast<HBRUSH>(::SelectObject(hdc, brush));
+ brushOld = SelectBrush(hdc, brush);
}
-
void SurfaceGDI::SetFont(Font &font_) {
if (font_.GetID() != font) {
const FormatAndMetrics *pfm = FamFromFontID(font_.GetID());
@@ -2725,7 +2724,7 @@ LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam
reinterpret_cast<HMENU>(static_cast<ptrdiff_t>(ctrlID)),
hinstanceParent,
0);
- WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(lb, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(ControlWndProc)));
+ WNDPROC prevWndProc = SubclassWindow(lb, ControlWndProc);
::SetWindowLongPtr(lb, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(prevWndProc));
}
break;
@@ -2808,9 +2807,8 @@ LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam
::ReleaseCapture();
}
return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
-
case WM_MOUSEWHEEL:
- wheelDelta -= static_cast<short>(HIWORD(wParam));
+ wheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam);
if (abs(wheelDelta) >= WHEEL_DELTA) {
const int nRows = GetVisibleRows();
int linesToScroll = 1;