Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Detect running application

Posted on 1999-06-30
14
Medium Priority
?
303 Views
Last Modified: 2010-04-17
How I am going to write VB 6.0 programming to detect either my application is running or not at the windows because my program I set the visible = false.

Somebody  ...help!!!!!!!!!!!

0
Comment
Question by:zubairi
[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
  • 5
  • 5
  • 4
14 Comments
 
LVL 7

Expert Comment

by:Inteqam
ID: 1534620
see

app.PrevInstance
0
 
LVL 86

Expert Comment

by:jkr
ID: 1534621
The previous instance is no longer valid in Win32. The way to go is to create an uniquely named object upon the start of your process, e.g.

HANDLE hMutex;

if ( INVALID_HANDLE_VALUE == CreateMutex ( NULL, FALSE, "MyApplicationsUniqueObject")
{
 if ( ERROR_ALREADY_EXISTS == GetLastError())
 {
   // there's already an instance of this app running...
 }
}

And don't forget to 'CloseHandle()' on the unique object ;-)

Sorry, C/C++, but the idea should be clear...

Feel free to ask if you need more information!

0
 

Author Comment

by:zubairi
ID: 1534622
Jkr..I know nothing about c/c++..so i am blur...you know..
Inteqam..what you mean by see app.PrevInstance

Can somebody else explain more detail about this issue.
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!

 

Author Comment

by:zubairi
ID: 1534623
Adjusted points to 55
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1534624
do you want to check if there is a previuos running application of your application ?

if yes , see app.PrevInstance


0
 

Author Comment

by:zubairi
ID: 1534625
Thanks inteqam...you always help me...Now what time there???
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1534626
welcome anytime , we are here to help

is that what you want?

0
 
LVL 86

Expert Comment

by:jkr
ID: 1534627
>>I know nothing about c/c++..

That doesn't matter, it's basically the same in VB ;-)

DIM 'CreateMutex' as ...
0
 

Author Comment

by:zubairi
ID: 1534628
Inteqam and Jkr
I got it...
Thank again both of you

0
 
LVL 86

Expert Comment

by:jkr
ID: 1534629
Fine! Hmm - so what is goint to happen with this Q?
0
 

Author Comment

by:zubairi
ID: 1534630
JKR:
I increase the point ??? You answer it...i will accept for you.

0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1534631
?Thanks inteqam...you always help me...

welcome

0
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 1534632
Thanx zubairi - I just didn't want to lock it again without your permission ...
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1534633
wow ,

this is the fifth "welcome" i get instead of points

:o)

0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress

670 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