Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to stop multiples of the same application from running

Status
Not open for further replies.

johnnyplang

Programmer
Apr 26, 2006
9
US
I have an application that opens in VB but when then action is triggered again another instance of the program opens instead of maximizing the first instance. I tried the below but that doesn't work.

hwnd = FindWindow(vbNullString, "program X")
If hwnd <> 0 Then
AppActivate "program X"
Else
Shell ("c:\Program X.exe")
End If

(where Program X is my application name)
 
Why not just create a whole other instance of the application? I'm assuming you're looking at creating an office application instance. Check out the GetObject/CreateObject methods. You should be able to get what you want from them.

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top