home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4310 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  1.5 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Bringing Application Windows to the top
  5. Message-ID: <719@lax.lax.pe-nelson.com>
  6. Date: 17 Dec 92 17:13:10 GMT
  7. References: <1992Dec17.122321.20939@cs.nott.ac.uk>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 27
  11.  
  12. In article <1992Dec17.122321.20939@cs.nott.ac.uk>, mak@vulcan.xtel.co.uk (Martijn Koster) writes:
  13. |> 
  14. |> Hi,
  15. |> I`ve got fairly simple question:
  16. |> 
  17. |>     Given a HWND, how can I bring an Application window to the top?
  18.  
  19. Try SetActiveWindow(hwnd) to bring the window specified by 'hwnd' to the
  20. top and making it the active window.
  21.  
  22.  
  23. |> To do this I check for a previous instance on startup, and if there
  24. |> is one I use EnumWindows to step through the windows looking for
  25. |> the one belonging to the previous instance.
  26.  
  27. As you mention, this works -- however since you are looking for a window
  28. that this application (albeit another instance) has created you could save
  29. a little effort by using FindWindow() with the registered name for the
  30. window class.
  31.  
  32.  
  33.  
  34. ----------------------------------------------------------------------------
  35. Tom Brown               |  "She turned me into a newt...
  36. PE Nelson Systems       |                                  ... I got better"
  37. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  38. ----------------------------------------------------------------------------
  39.