Advertisement
Guest User

Untitled

a guest
May 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Private Declare Function WaitForSingleObject Lib "kernel32" _
  2. (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
  3. Private Declare Function OpenProcess Lib "kernel32" (ByVal dwAccess As _
  4. Long, ByVal fInherit As Integer, ByVal hObject As Long) As Long
  5. Private Declare Function CloseHandle Lib "kernel32" _
  6. (ByVal hObject As Long) As Long
  7. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
  8. (ByVal lpszClassName As String, ByVal lpszWindow As String) As Long
  9. Sub Main()
  10. Do
  11. Dim lPid As Long, hProc As Long, lTimeout As Long
  12. hProc = OpenProcess(SYNCHRONIZE, 0&, FindWindow(vbNullString, "taskmgr.exe"))
  13. If hProc <> 0& Then
  14. WaitForSingleObject hProc, 1000000000#
  15. CloseHandle hProc
  16. MsgBox "sdfgdfgsdf"
  17. End If
  18. Loop
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement