summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video/win32_v.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 23794cb32..4534b87be 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -38,6 +38,9 @@
#define PM_QS_INPUT 0x20000
#endif
+typedef BOOL (WINAPI *PFNTRACKMOUSEEVENT)(LPTRACKMOUSEEVENT lpEventTrack);
+static PFNTRACKMOUSEEVENT _pTrackMouseEvent = NULL;
+
static struct {
HWND main_wnd;
HBITMAP dib_sect;
@@ -747,7 +750,16 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
* tracking the mouse for exiting the window */
if (!_cursor.in_window) {
_cursor.in_window = true;
- SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
+ if (_pTrackMouseEvent != NULL) {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+
+ _pTrackMouseEvent(&tme);
+ } else {
+ SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
+ }
}
if (_cursor.fix_at) {
@@ -1038,6 +1050,9 @@ static void RegisterWndClass()
registered = true;
if (!RegisterClass(&wnd)) usererror("RegisterClass failed");
+
+ /* Dynamically load mouse tracking, as it doesn't exist on Windows 95. */
+ _pTrackMouseEvent = (PFNTRACKMOUSEEVENT)GetProcAddress(GetModuleHandle(_T("User32")), "TrackMouseEvent");
}
}