?
Solved

How to run a another application in sync.

Posted on 2002-07-26
13
Medium Priority
?
151 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 450 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 In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

743 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