ioa747 Posted August 26 Share Posted August 26 (edited) ==> The requested action with this object has failed.: What am I doing wrong here? https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setthumbnailtooltip expandcollapse popup#include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WinAPIError.au3> $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() _SetThumbnailTooltip($hGUI, "AutoIt v3" & @CRLF & "A BASIC-like scripting language") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) Func _SetThumbnailTooltip($hWnd, $sText) ; Declare the CLSID, IID, and interface description for ITaskbarList3. Local Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Local Const $sIID_ITaskbarList3 = "{ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf}" Local Const $sTagITaskbarList3 = "HrInit hresult(); AddTab hresult(hwnd); DeleteTab hresult(hwnd); SetThumbnailTooltip hresult(hwnd;wstr);" ; Create the object. Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $sTagITaskbarList3) ; Initialize the iTaskbarList3 object. $oTB.HrInit() Sleep(3000) ; Delete the entry from the Taskbar. $oTB.DeleteTab($hWnd) Sleep(3000) ; AddTab the entry to Taskbar. $oTB.AddTab($hWnd) Sleep(3000) ; Attempt to set the tooltip for the taskbar thumbnail $sHresult = $oTB.SetThumbnailTooltip($hWnd, $sText) EndFunc Please, every comment is appreciated! Thank you very much Edited August 26 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
Popular Post ioa747 Posted August 26 Author Popular Post Share Posted August 26 (edited) i found solution here (Thanks to LarsJ ) https://www.autoitscript.com/forum/topic/205154-using-objcreateinterface-and-objectfromtag-functions/ Methods/properties of the description tag string must be in correct Vtable order. (I learned what Vtable is) expandcollapse popup; https://www.autoitscript.com/forum/topic/212211-solved-setthumbnailtooltip #include <GUIConstantsEx.au3> $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() _SetThumbnailTooltip($hGUI, "AutoIt v3" & @CRLF & "including a line breaker" & @CRLF & "in gui ThumbnailTooltip") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) Func _SetThumbnailTooltip($hWnd, $sText) ; Declare the CLSID, IID, and interface description for ITaskbarList3. Local Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Local Const $sIID_ITaskbarList3 = "{ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf}" Local Const $sTagITaskbarList3 = "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" ; Create the object. Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $sTagITaskbarList3) ; Initialize the iTaskbarList3 object. $oTB.HrInit() ; Attempt to set the tooltip for the taskbar thumbnail $oTB.SetThumbnailTooltip($hWnd, $sText) EndFunc ;==>_SetThumbnailTooltip Edited August 26 by ioa747 Danyfirex, CYCho, argumentum and 2 others 5 I know that I know nothing Link to comment Share on other sites More sharing options...
KaFu Posted August 26 Share Posted August 26 Nice 👍 ioa747 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ioa747 Posted August 30 Author Share Posted August 30 the continuation here... argumentum 1 I know that I know nothing 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