Solved

How to run a another application in sync.

Posted on 2002-07-26
13
140 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now