🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Novice programmer question

#1718
From: TYLER DAVID CHARLES
Date: Sun, 13 Dec 1992 20:42
37 lines
1543 bytes
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
Technical Details
Message-ID: <1992Dec13.204238.8073@ucsu.Colorado.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!ncar!csn!boulder!ucsu!rintintin.Colorado.EDU!tylerd

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