Solved

How to run a another application in sync.

Posted on 2002-07-26
13
144 Views
Last Modified: 2010-05-02
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
Comment
Question by:DragonWolf
  • 7
  • 5
13 Comments
 
LVL 1

Author Comment

by:DragonWolf
ID: 7179829
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
 
LVL 4

Expert Comment

by:gencross
ID: 7179842
Where is this second question posted at?

Did the code I provided help you in answering the first question(s)?
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7179909
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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 1

Author Comment

by:DragonWolf
ID: 7179911
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
 
LVL 1

Author Comment

by:DragonWolf
ID: 7179912
Thanks Priya
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7179913
sorry that should be:

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

-priya
0
 
LVL 2

Accepted Solution

by:
priya_pbk earned 150 total points
ID: 7179922
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
 
LVL 1

Author Comment

by:DragonWolf
ID: 7179924
priya

Whats the difference between the those two snippets of code in your comments?
0
 
LVL 1

Author Comment

by:DragonWolf
ID: 7179926
hehe
    I thought so ^^
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7179930
BTW, it should be "End" and not "Exit Sub"

0
 
LVL 1

Author Comment

by:DragonWolf
ID: 7179937
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
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7179957
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
 
LVL 1

Author Comment

by:DragonWolf
ID: 7180140
Just tried it.
Same effect as if I left out the cmd.exe
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question