Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Declare Function WaitForSingleObject Lib "kernel32" _
- (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
- Private Declare Function OpenProcess Lib "kernel32" (ByVal dwAccess As _
- Long, ByVal fInherit As Integer, ByVal hObject As Long) As Long
- Private Declare Function CloseHandle Lib "kernel32" _
- (ByVal hObject As Long) As Long
- Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
- (ByVal lpszClassName As String, ByVal lpszWindow As String) As Long
- Sub Main()
- Do
- Dim lPid As Long, hProc As Long, lTimeout As Long
- hProc = OpenProcess(SYNCHRONIZE, 0&, FindWindow(vbNullString, "taskmgr.exe"))
- If hProc <> 0& Then
- WaitForSingleObject hProc, 1000000000#
- CloseHandle hProc
- MsgBox "sdfgdfgsdf"
- End If
- Loop
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement