aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
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;