home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / os2 / programm / 7144 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.5 KB  |  33 lines

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