Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How keep alive some .exe 1

Status
Not open for further replies.

MickeD

Programmer
Feb 20, 2000
54
Hi,

I have some EXE file doing some process (get messages and update database)
This process is very important for our organisation and it must be alive 24 hours.
How can i know from another app is this process alive? In case Error or other message I must be able to close it . If prosess is down or not responding i must restart it (or/and computer)
any advice?
 
Is it a windows application, a VB project?
Can they comunicate by DDE ( Dynamic Data Exchange )?
Can this process set up a lap allowing the remote control too?

I need some dettail to help you, sorry!
 
Yes , It is a Windows application but no VB project so i havn't source code.
any idea?
 
You can use the AppActiveate command to see if the program is alive, as long as it has an active window. AppActivate uses the title of all open windows in the system to find the app and activate it. If the app isn't found, an error 5 occurs, so you can trap for that. If it is found, your code will continue to execute, so you can then get focus back by doing a show on your form.

To see how this works, create a new project, add a button to form1 and then paste in the following code:

Private Sub Command1_Click()

On Error GoTo Command1_Err

AppActivate ("calculator")

Me.Show

Exit Sub

Command1_Err:

If Err.Number = 5 Then
MsgBox "App not found"
Shell "Calc.exe", vbMinimizedNoFocus
End If

End Sub

Run the project and click the button. Calc.exe isn't running so it gets loaded. Now click it again. It is found so it doesn't get loaded again.

Hope that helps.
 
I have one VB program to be like this alive for 24 hrs in a sever or on a remote machine. Is there any way to find whether that program is live or not from a local machine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top