home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!gatech!ncar!csn!boulder!ucsu!rintintin.Colorado.EDU!tylerd
- From: tylerd@rintintin.Colorado.EDU (TYLER DAVID CHARLES)
- Subject: Novice programmer question
- Message-ID: <1992Dec13.204238.8073@ucsu.Colorado.EDU>
- Sender: news@ucsu.Colorado.EDU (USENET News System)
- Nntp-Posting-Host: rintintin.colorado.edu
- Organization: University of Colorado, Boulder
- Distribution: usa
- Date: Sun, 13 Dec 1992 20:42:38 GMT
- Lines: 37
-
- I'll make this brief:
- Why doesn't the following work?
-
- if (!hPrevInstance)
- {
- [normal stuff]
- }
- else
- //
- // If an instance is already running, just display it.
- //
- {
- if (IsIconic (hPrevInstance))
- {
- OpenIcon (hPrevInstance);
- }
- BringWindowToTop (hPrevInstance);
- return TRUE; // Or should this be FALSE?
- }
-
- All I'm trying to do is keep only one instance running at a time.
- If the user tries to open a new instance, bring the already-
- running program to the top, as a window (Like File Manager does).
- Using the above code, nothing happens. No new instance, but
- also no effect on the previous iconized (or windowed) instance.
-
- These functions ARE in windows.h, aren't they?
- I am using Turbo C++ for Windows, if that makes a difference.
-
- Thanks in advance for any help. I realize there must be a simple
- explanation, but I sure don't know what it is!
-
- Please e-mail replies, since I don't normally read this newsgroup.
-
- Dave
-
- tylerd@rintintin.Colorado.edu
-