Solved

Get focus to the application that is already started...

Posted on 2001-06-18
5
143 Views
Last Modified: 2010-05-03
Hi all,
 
   i start an executable. When i start the same executable i want to close the later one and i want the former to be on the top of the window list (or desktop)...
How can i achieve this.

rgds
suresh
0
Comment
Question by:chvsuresh
  • 2
  • 2
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6201958
I think with the property App.PrevInstance you can check if the application is already running
Then, using the AppActivate method, you can bring the other instance to the foreground...

Hope this helps
0
 
LVL 33

Accepted Solution

by:
hongjun earned 50 total points
ID: 6201995
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7135248
A request has been made (http://www.experts-exchange.com/cleanup/Q_20320181.html) that this question be closed with the following resolution: points refund and PAQ

EXPERTS: Please leave any comment regarding this request here; I will return in seven (7) days to close the question.

Netminder
CS Moderator
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7135252
A request has been made (http://www.experts-exchange.com/cleanup/Q_20320181.html) that this question be closed with the following resolution: points refund and PAQ

EXPERTS: Please leave any comment regarding this request here; I will return in seven (7) days to close the question.

Netminder
CS Moderator
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7137008
Although i said "i think", my comment should solve the question.
And hongjun's link is even more complete, as it includes the complete code...
CHeers
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

747 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

10 Experts available now in Live!

Get 1:1 Help Now