home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!yoyo.cc.monash.edu.au!parry
- From: parry@yoyo.cc.monash.edu.au (Tom J Parry)
- Subject: Re: X-Windows like mouse/focus behavior (here's how)
- Message-ID: <1992Dec20.004902.25186@monu6.cc.monash.edu.au>
- Originator: parry@yoyo.cc.monash.edu.au
- Sender: news@monu6.cc.monash.edu.au (Usenet system)
- Organization: Monash University, Melb., Australia.
- References: <1992Dec16.145017.23804@panix.com>
- Date: Sun, 20 Dec 1992 00:49:02 GMT
- Lines: 20
-
- Larry Salomon Jr. (os2man@panix.com) wrote:
- > For those interested, I've seen quite a few requests for this behavior.
- > Although I haven't tried the below, it should work; no guarantees, however.
-
- > The strategy here is to install a system-wide HK_INPUT hook which follows
- > the WM_MOUSEMOVE messages. You can easily call WinWindowFromPoint() to
- > obtain the window handle under the mouse, follow the parent chain until
- > you reach the top-level window, and call WinSetFocus() to give it the focus.
-
- You don't need to follow the parent chain, you can do
- WinWindowFromPoint(HWND_DESKTOP, &ptl, FALSE). The FALSE means don't look
- at children windows so the window returned will be a child of HWND_DESKTOP.
- If you do decide to trace backwards for some reason be careful not to
- compare anything to HWND_DESKTOP. HWND_DESKTOP is a constant (0 or 1)
- whereas a window function will return the handle of the desktop window
- (0x201383 or something similar on mine).
-
- --
- Tom J Parry.
- Your reality is a figment of my imagination.
-