View Single Post
Old 06 May 2017, 17:01   #13
Registered User
Join Date: Aug 2004
Posts: 2,829
After some testing with winuae.7z 2017-05-06 13:48 I couldn't get the mouse to uncapture, either using Windows mouse or raw input. Great!

However, if the size/position of the taskbar (and hence the work area) changes, WinUAE doesn't notice that and the mouse can become uncaptured then. For example:
  • Start emulation.
  • Un-capture mouse, move over the taskbar, right-click and make sure "Lock the taskbar" is not checked.
  • Drag the top border of the taskbar upwards to make it thicker.
  • Move emulation window so it's partly over the taskbar. Click in it and move mouse around.
The same thing happens if you move the taskbar to be vertical (on the left or right side of the screen).

Another problem is that if you have the taskbar set to auto-hide, WinUAE (at least the test version I mentioned) hangs on starting emulation. [On Windows 10, enable auto-hide by right-clicking taskbar, select Taskbar settings, then set "Automatically hide the taskbar in desktop mode" to On.]

The same hang happens if "Keep the taskbar on top of other windows" is not checked on Windows XP (and Vista too I assume).

Reading the MSDN page about the taskbar...
"The taskbar supports two display options: Auto-Hide and, in Windows Vista and earlier only, Always On Top (the taskbar is always in this mode in Windows 7 and later). To set these options, the user must open the taskbar shortcut menu, click Properties, and select or clear the Auto-hide the taskbar check box or the Keep the taskbar on top of other windows check box. To retrieve the state of these display options, use the ABM_GETSTATE message. If you would like to be notified when the state of these display options changes, process the ABN_STATECHANGE notification message in your window procedure."

So it looks like you could/should query the work area rect on receiving an ABN_STATECHANGE message. (Or maybe just every time the mouse is captured???)

ABM_GETSTATE seems a bit useless with regard to ABS_ALWAYSONTOP, because the doc says "Note As of Windows 7, ABS_ALWAYSONTOP is no longer returned because the taskbar is always in that state. Older code should be updated to ignore the absence of this value in not assume that return value to mean that the taskbar is not in the always-on-top state."

Last edited by mark_k; 06 May 2017 at 17:20.
mark_k is offline  
Page generated in 0.09946 seconds with 9 queries