• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

How to run a another application in sync.

Hi all,
    I'm looking for a way to run a shell command (Linking to another .exe) in sync (i.e. my program will will not continue to execute until the other application ends).

    How can I also detect if my application (NOT the one I'm calling) is already running (since I only want one instance of it running ever)

    Thanks
0
DragonWolf
Asked:
DragonWolf
  • 7
  • 5
1 Solution
 
DragonWolfAuthor Commented:
I can now run a program in sync,
My second question still needs answering,
when executing a DOS .exe file, using the shell() can I make it full screen?
0
 
gencrossCommented:
Where is this second question posted at?

Did the code I provided help you in answering the first question(s)?
0
 
priya_pbkCommented:
you can check for any of the previous Instance if running like this:

Private Sub Form_Load()
if App.PrevInstance<>0 then Msgbox "Appication already running" :End
End Sub

Hope this helps!

-priya
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DragonWolfAuthor Commented:
what code?

The questions I'm currently asking are only in this thread,
they are:

  How can I also detect if my application is already running (since I only want one instance of it running ever)

  How can I run a DOS exe file in full screen?
0
 
DragonWolfAuthor Commented:
Thanks Priya
0
 
priya_pbkCommented:
sorry that should be:

Private Sub Form_Load()
if App.PrevInstance<>0 then Msgbox "Appication already running" :End
End Sub

-priya
0
 
priya_pbkCommented:
sorry again, i pasted the same code:

It should be :

Private Sub Form_Load()
If App.PrevInstance = True Then MsgBox "Application already Running": Exit Sub
End sub

-priya :0)

0
 
DragonWolfAuthor Commented:
priya

Whats the difference between the those two snippets of code in your comments?
0
 
DragonWolfAuthor Commented:
hehe
    I thought so ^^
0
 
priya_pbkCommented:
BTW, it should be "End" and not "Exit Sub"

0
 
DragonWolfAuthor Commented:
Question had changed so much, that I sohuld have started a new thread, but priya answered one of the many questions in this thread.

    Thankx ^^
0
 
priya_pbkCommented:
Thanks for the points!

ok, for the opening it as full screen,use the shell function like this:

syntax:
Shell pathName, vbMaximizedFocus

[where pathname is where your command prompt exe exists in your C:\....

hope this helps(i have not tested)]
-priya

0
 
DragonWolfAuthor Commented:
Just tried it.
Same effect as if I left out the cmd.exe
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now