🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1982

Bringing Application Windows to the top

#1982
From: Martijn Koster
Date: Thu, 17 Dec 1992 12:23
20 lines
1140 bytes
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
Technical Details
Message-ID: <1992Dec17.122321.20939@cs.nott.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!nott-cs!vulcan.xtel.co.uk!mak

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!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