Solved

How to run a another application in sync.

Posted on 2002-07-26
13
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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!

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

726 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