home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / misc / 3270 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.2 KB  |  45 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!gumby!yale!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!tamsun.tamu.edu!zeus.tamu.edu!sam4628
  3. From: sam4628@zeus.tamu.edu
  4. Subject: Re: Changing Window's focus: possible?
  5. Message-ID: <6NOV199207570849@zeus.tamu.edu>
  6. News-Software: VAX/VMS VNEWS 1.41    
  7. Sender: news@tamsun.tamu.edu (Read News)
  8. Organization: Texas A&M University, Academic Computing Services
  9. References: <4NOV199210331435@zeus.tamu.edu> <682@lax.lax.pe-nelson.com> <1992Nov5.145745.3278@hyper.hyper.com>
  10. Date: Fri, 6 Nov 1992 13:57:00 GMT
  11. Lines: 32
  12.  
  13. >>In article <4NOV199210331435@zeus.tamu.edu>, sam4628@zeus.tamu.edu writes:
  14. >>|> Is it possible to write a program which changes the way Windows focuses?
  15. >>|> I would like the active window to be selected by mouse pointer position,
  16. >>|> without necessarily bringing the window to the front.  Has anybody done
  17. >>|> anything similar to this?  Thanks.
  18.  
  19. To follow up on my original post: I have managed to write a program which
  20. brings to the front and makes active whichever window the mouse cursor is
  21. over.  There are still a few (major) problems:
  22.  
  23. When I bring up a menu and move the mouse down, the menu disappears (I
  24. think I can solve this problem by only changing focus when the mouse
  25. moves to a different parent window).  The other problem is that the
  26. newly focussed window is automatically brought forward -- I would like
  27. to be able to have an overlapped active window.
  28.  
  29. The program so far just sets a hook for mouse messages which uses
  30. WindowFromPoint to get the handle of the window located at the cursor
  31. position (if any) and SetFocus to change the focus to that window.
  32. (SetFocus must be responsible for bringing the focussed window forward --
  33. I don't know if there's a simple way around this.)
  34.  
  35. Just in case anybody is inclined to tell me what a stupid idea and/or
  36. method this is, bear in mind that this is the first windows program I've
  37. ever written.
  38.  
  39. Steven M.
  40.  
  41. P.S.  I typed in the HELLOWIN example out of Petzold (using BC++) and got
  42. it to work with minor mods.  However, I get a warning that I'm trying to
  43. export a non-public function when I include my window proc in the EXPORT
  44. line of the DEF file.  Any suggestions?
  45.