Solved

How to run a another application in sync.

Posted on 2002-07-26
13
145 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

696 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