[PATCH 1/2] dinput: Use WINDPROC hook to monitor focus loses away from monitored windows.

Vitaliy Margolen wine-patches at kievinfo.com
Sun Jun 10 20:20:13 CDT 2007


This is required for dinput to release mouse when foreground window becomes
background. And coop level is DISCL_FOREGROUND.
Here I'm using single hook that handles multiple devices.

Changes from try3:
We don't really care about focus, but about window being foreground or not. For
this react to few messages that could be sent when windows becomes background
and explicitly check if window is no longer foreground.

Changes from try2:
Tried idea with window subclassing. This didn't work. Here just for history.

Changes from try1:
Ignore hook message if it's not WM_KILLFOCUS - no need to iterate
through all the device for the wrong message.
---
 dlls/dinput/device.c         |    5 +++
 dlls/dinput/dinput_main.c    |   81 ++++++++++++++++++++++++++++++++++++++++++
 dlls/dinput/dinput_private.h |    2 +
 dlls/dinput/tests/mouse.c    |    1 -
 4 files changed, 88 insertions(+), 1 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: de7dac79103624a73f14c00da7ed9b18d294decf.diff
Type: text/x-patch
Size: 4947 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070610/437a1731/de7dac79103624a73f14c00da7ed9b18d294decf.bin


More information about the wine-patches mailing list