ick no!!!
software that periodcally checks for changes like this, bad, bad!
loading regmon or filemon watching all those programs rabidly checking for registry or file changes is horrible.
even on a simple system, you are opening a can of worms.
FindFirstChangeNotification, WaitForSingleObject etc
implement semaphores, windows has some very powerful functions for talking between apps.
http://msdn.microsoft.com arguably has the best technical docs/resources for any OS.
afrer a few mins looking msdn i found this
Code:
Example Program
This program shows how you can use the Shell function and the GetNumTasks function to execute an MS-DOS program. This program assumes that you have the PKUNZIP program stored in the UTILS directory and that you have previously created a destination directory called DESTDIR on your hard drive.
Create a new project in Visual Basic. Form1 is created by default.
Add the following statements to the General Declarations section of Form1:
Dim ActiveApps As Integer
Private Declare Function GetNumTasks Lib "Kernel" () As Integer
Add a Command Button control to Form1. Command1 is created by default.
Add the following code to the Click event for Command1:
Private Sub Command1_Click()
Dim AppDir As String
Dim Zip As String
Dim Y As Integer
Dim X As Integer
AppDir = "c:\destdir"
ActiveApps = GetNumTasks()
Zip = "c:\utils\pkunzip " & "c:\destdir\" & "test.zip" & " " & AppDir
X = Shell(Zip, 2)
SendKeys "%{enter}EXIT%{ }n"
Do While GetNumTasks() <> ActiveApps
Y = DoEvents()
Loop
MsgBox "Pkunzip is finished", 0, "Demo Program"
End Sub
Then this
http://support.microsoft.com/default...kb;en-us;96844
Code:
Private Declare Function GetModuleUsage% Lib "Kernel" _
(ByVal hModule%)
Private Function TestFunc(ByVal lVal As Long) As Integer
'this function is necessary since the value returned by Shell is an
'unsigned integer and may exceed the limits of a VB integer
If (lVal And &H8000&) = 0 Then
TestFunc = lVal And &HFFFF&
Else
TestFunc = &H8000 Or (lVal And &H7FFF&)
End If
End Function
Add the following code to the Form_Click event procedure of Form1: Sub Form_Click()
lRet& = Shell("NOTEPAD.EXE") ' Modify the path as necessary.
x% = TestFunc(lRet&)
While GetModuleUsage(x%) > 0 ' Has Shelled program finished?
z% = DoEvents() ' If not, yield to Windows.
Wend
MsgBox "Shelled application just terminated", 64
End Sub