home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3916 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.6 KB

  1. Path: sparky!uunet!wupost!cs.utexas.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
  2. From: dic5340@hertz.njit.edu (David Charlap)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: how to give program the focus?
  5. Message-ID: <1992Jul30.212808.29729@njitgw.njit.edu>
  6. Date: 30 Jul 92 21:28:08 GMT
  7. References: <9207292038.AA20166@data.src.honeywell.com>
  8. Sender: news@njit.edu
  9. Organization: New Jersey Institute of Technology, Newark, N.J.
  10. Lines: 32
  11. Nntp-Posting-Host: hertz.njit.edu
  12.  
  13. In article <9207292038.AA20166@data.src.honeywell.com> bergstro@src.honeywell.com (Pete Bergstrom) writes:
  14. >
  15. >This may be a relatively easy answer, but I want to capture mouse button
  16. >clicks on my window.  I've done this by processing WM_BUTTON1DOWN and
  17. >I do get the coordinates I want.
  18. >
  19. >But, when I do this, the title bar for my window loses the focus
  20. >(grays out).  When this happens, I can't use ALT-F, etc key
  21. >combinations to navigate the menus until I explicitly click on the
  22. >title bar (or menu bar) again.
  23. >
  24. >So, how do I make sure that the window retains the focus?
  25.  
  26. Could you post the code fragment?
  27.  
  28. Anyhow, I've two ideas.
  29.  
  30. 1) Is the message handler associated with the window or with the
  31.    frame?  I think message handlers should be associated with the
  32.    frame. 
  33.  
  34. 2) At the end of your handler, are you calling WinDefWindowProc()?
  35.    This is especially important, or you won't get any default handling
  36.    for the other messages.
  37.  
  38.  
  39.  
  40. -- 
  41.    |)  David Charlap           "I don't even represent myself
  42.   /|_  dic5340@hertz.njit.edu   sometimes so NJIT is right out!.
  43.  ((|,)
  44.   ~|~  Hi! I am a .signature virus, copy me into your .signature file.
  45.