Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Run Program When Specific App. shuts down


Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2007, 05:09 AM
kkedarvk kkedarvk is offline
Newcomer
 
Join Date: May 2007
Posts: 5
Question Run Program When Specific App. shuts down


Hi, I have written program for data backup in VB. I want to run this program when another third party program shuts down. when this program shuts down, my program shoud take backup. Any idea?
Can I add my program to run in the shortcut of third party program as dos batch file can add many commands? or my program should stay in tray on startup and detect the closure of that third party app? if yes, how?
Reply With Quote
  #2  
Old 08-06-2007, 01:32 PM
tHuNd3r's Avatar
tHuNd3r tHuNd3r is offline
Junior Contributor
 
Join Date: Jul 2003
Location: Brazil
Posts: 213
Default

The EnumProcess API should return all running applications in the system:
http://allapi.mentalis.org/apilist/EnumProcesses.shtml

Use it to seek for the third part application and mark a variable to "true" when you see it running, then when you don't see the third part app at the proccess anymore, you check the variable, if the value is "true", start the backup proccess and set the variable back to "false"

Regards,
__________________
tHuNd3rSp0t

Believe
Dreaming is the first step for any conquest
Reply With Quote
  #3  
Old 08-07-2007, 01:29 AM
kkedarvk kkedarvk is offline
Newcomer
 
Join Date: May 2007
Posts: 5
Default

Thanks tHuNd3rSp0t, Thanks a lot, with little tweaking it worked fine. Now I am able to check if that application is running or not. it is not supporting win 9x or me, is there any way to for 9x or me?

How can I make my program to run at startup and place it's icon in tray.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->