home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!pipex!warwick!nott-cs!vulcan.xtel.co.uk!mak
- From: mak@vulcan.xtel.co.uk (Martijn Koster)
- Subject: Bringing Application Windows to the top
- Message-ID: <1992Dec17.122321.20939@cs.nott.ac.uk>
- Sender: news@cs.nott.ac.uk
- Organization: X-Tel Services Ltd.
- Date: Thu, 17 Dec 92 12:23:21 GMT
- Lines: 20
-
-
- Hi,
- I`ve got fairly simple question:
-
- Given a HWND, how can I bring an Application window to the top?
-
- I want only one instance of my application to run, and like in the
- File Manager I'd like the current instance of my program to come
- to the front when the user selects my program-item from the
- Program Manager.
- To do this I check for a previous instance on startup, and if there
- is one I use EnumWindows to step through the windows looking for
- the one belonging to the previous instance. This works fine, I
- can set the title of that window. But now I want to bring that
- application to the top. I tried SetWindowPos(hwnd, HWND_TOPMOST,
- 0, 0, 0, 0, WPS_NOSIZE | WPS_NOMOVE), but nothing happens.
-
- Any suggestions greatly appreciated.
-
- -- Martijn
-