🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10014

Re: Run Once

#10014
From: Bob Gonder
Date: Sun, 30 May 2004 20:58
22 lines
1948 bytes
JD wrote:

>I implemented code in the WinMain to prevent multiple instances
>of the application from running. I have a problem and a couple
>questions as noted in the code:
>
>First, IsIconic always returns false no matter what the state
>so I can't determine the window state of the HWND and I have no
>clue why. I confirmed that the correct window was being found
>by overriding the WndProc method and posting a message to the
>first instance window. It is the correct HWND.

If you can post a message to the original instance, then what's the
problem?
Have the original instance (which knows it's current display
attributes) restore itself (when it receives that message) and display
the passed filename.

Or you could also throw in a named pipe that the mutex owner is
reading, and the second instance then writes it's commandline to the
pipe before exiting. The original instance sees data on the pipe and
restores itself and processes the commandline.
Technical Details
Message-ID: <k5ikb0dppip15jep979bhuf7g148fsp3lj@4ax.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40b9cff4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,55fa8aeaf57fcad1
X-Google-Attributes: gid10cc67,public
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Run Once
Date: Sun, 30 May 2004 13:58:14 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <k5ikb0dppip15jep979bhuf7g148fsp3lj@4ax.com>
References: <40b9cff4$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.99.167
X-Trace: newsgroups.borland.com 1085950692 69.69.99.167 (30 May 2004 13:58:12 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail