Exit Posted June 5, 2019 Share Posted June 5, 2019 (edited) This topic has been solved. Thanks to @InnI I want to hide the screen magnifier icon from the taskbar. For this I used the help example of the function ObjCreateInterface () and only added the code for Magnify.exe in addition to the Notepad example. The Notepad icon is easily removed, but the Magnify icon remains in the taskbar and the magnifier does not end. Why? By the way: The hotkeys WIN + NUMPADADD and WIN + ESC switch the screen magnifier on and off. Here the modified script expandcollapse popup; Hide the screen magnifying icon. #include <MsgBoxConstants.au3> Example() Func Example() ; Declare the CLSID, IID and interface description for ITaskbarList. ; It is not necessary to describe the members of IUnknown. Local Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Local Const $sIID_ITaskbarList = "{56FDF342-FD6D-11D0-958A-006097C9A090}" Local Const $sTagITaskbarList = "HrInit hresult(); AddTab hresult(hwnd); DeleteTab hresult(hwnd); ActivateTab hresult(hwnd); SetActiveAlt hresult(hwnd);" ; Create the object. Local $oTaskbarList = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList, $sTagITaskbarList) ; Initialize the iTaskbarList object. $oTaskbarList.HrInit() ; Run Notepad. ShellExecute("notepad.exe") ; Run Magnify. ShellExecute("Magnify.exe") ; Wait for the Notepad window to appear and get a handle to it. Local $hNotepad = WinWait("[CLASS:Notepad]") ConsoleWrite("Error: " & @error & " Extended: " & @extended & " hNotepad: " & $hNotepad & @LF) ; Wait for the Magnify window to appear and get a handle to it. ;~ Local $hMagnify = WinWait("[CLASS:MagUIIconClass]") ; ############# this was NOT correct ################### Local $hMagnify = WinWait("[CLASS:MagUIClass]") ; ############# this is correct ################### ConsoleWrite("Error: " & @error & " Extended: " & @extended & " hMagnify: " & $hMagnify & @LF) ; Tell the user what to look for. MsgBox($MB_SYSTEMMODAL, "", "Look in the Taskbar and you should see an entry for Notepad and Magnify." & @CRLF & @CRLF & "Press OK to continue.") ; Delete the Notepad entry from the Taskbar. $oTaskbarList.DeleteTab($hNotepad) ; Delete the Magnify entry from the Taskbar. $oTaskbarList.DeleteTab($hMagnify) ; ############# this works now correct ################### ; Tell the user to look again. MsgBox($MB_SYSTEMMODAL, "", "Look in the Taskbar. There should no longer be a Notepad and Magnify entry but Notepad and Magnify are still running." & @CRLF & @CRLF & "Press OK to continue.") ; Close Notepad. WinClose($hNotepad) ; Close Magnify. WinClose($hMagnify) ; ############# this works now correct ################### EndFunc ;==>Example Edited June 6, 2019 by Exit Topic solved App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
InnI Posted June 6, 2019 Share Posted June 6, 2019 Local $hMagnify = WinWait("[CLASS:MagUIClass]") Exit 1 Link to comment Share on other sites More sharing options...
Exit Posted June 6, 2019 Author Share Posted June 6, 2019 (edited) @InnI Thanks. Now all is OK. Edited June 6, 2019 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now