By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,712 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,712 IT Pros & Developers. It's quick & easy.

How to check if software is already running

P: n/a
HI folks can anyone help a newbie here.

I would like to know how I can check if my software is already running.
So that if the user click s on the shortcut to start the progam again
it maximises the already running program.

tia

Amrik
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
App.PrevInstance will tell you

Actually communicating with the previous App is a bit more complicated
- this involves finding its hWnd
- or that of an obliging sub-window - eg: a Textbox

( I discarded AppActivate and SendKeys years ago )

Look into the FindWindow API ...

On Thu, 10 Jul 2003 10:34:04 +0000 (UTC), Amrik Singh
<am*********@btinternet.com> wrote:
HI folks can anyone help a newbie here.

I would like to know how I can check if my software is already running.
So that if the user click s on the shortcut to start the progam again
it maximises the already running program.

tia

Amrik


Jul 17 '05 #2

P: n/a
Amrik Singh <am*********@btinternet.com> wrote in message news:<VA******************@btinternet.com>...
HI folks can anyone help a newbie here.

I would like to know how I can check if my software is already running.
So that if the user click s on the shortcut to start the progam again
it maximises the already running program.


You could try something like this...

Private Sub Form_Initialize()
Rem check if a previous instance is running
If App.PrevInstance Then
temp = MsgBox("Another version of this program is already
running", vbOKOnly, "Unable to start")
End 'close this instance
End If
End Sub
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.