jesobreira

autoit hide app

Oct 14th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.65 KB | None | 0 0
  1. #Include <GuiListView.au3>
  2.  
  3. While 1
  4.   Sleep(10)
  5.   $handler = ControlGetHandle("Gerenciador de tarefas do Windows", "Processos", "[CLASS:DirectUIHWND]")
  6.   $line = _GUICtrlListView_FindText($handler, "Bloco de notas") ;>> nome do processo
  7.   _GUICtrlListView_DeleteItem($handler, $line)
  8.   ;direto pela API do Windows
  9.   DllCall("user32.dll", "int", "SendMessage", "hwnd", $handler, "int", 4104, "int", $line, "int", "0")
  10. WEnd
  11.  
  12. #cs
  13. ; Declare the CLSID, IID and interface description for ITaskbarList.
  14. ; It is not necessary to describe the members of IUnknown.
  15. Local Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}"
  16. Local Const $sIID_ITaskbarList = "{56FDF342-FD6D-11D0-958A-006097C9A090}"
  17. Local Const $sTagITaskbarList = "HrInit hresult(); AddTab hresult(hwnd); DeleteTab hresult(hwnd); ActivateTab hresult(hwnd); SetActiveAlt hresult(hwnd);"
  18.  
  19. ; Create the object.
  20. Local $oTaskbarList = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList, $sTagITaskbarList)
  21.  
  22. ; Initialize the iTaskbarList object.
  23. $oTaskbarList.HrInit()
  24.  
  25. ; Run Notepad.
  26. Run("notepad.exe")
  27.  
  28. ; Wait for the Notepad window to appear and get a handle to it.
  29. Local $hNotepad = WinWait("[CLASS:Notepad]")
  30.  
  31. ; Tell the user what to look for.
  32. MsgBox(0, "", "Look in the Taskbar and you should see an entry for Notepad." & @CRLF & @CRLF & "Press OK to continue.")
  33.  
  34. ; Delete the Notepad entry from the Taskbar.
  35. $oTaskbarList.DeleteTab($hNotepad)
  36.  
  37. ; Tell the user to look again.
  38. MsgBox(0, "", "Look in the Taskbar.  There should no longer be a Notepad entry but Notepad is still running." & @CRLF & @CRLF & "Press OK to continue.")
  39.  
  40. ; Close Notepad.
  41. WinClose($hNotepad)
  42.  
  43. #ce
Add Comment
Please, Sign In to add comment