Jump to content
Beege

ITaskBarList UDF - Rewrite for Beta All Methods Included

Recommended Posts

Beege

Woo this is awesome Posted Image

Very good job there!

James

Thankyou! Glad to hear you liked it :(

Share this post


Link to post
Share on other sites
James

I've been trying to implement jump lists, but that seems to be so much more riddled with things. I have some PureBasic source, but since I don't know it, it's a bit confusing at times.

I too, am using AutoItObject :(

James

Share this post


Link to post
Share on other sites
gooker

Updated 3-17-2010: Fixed Dll structure to work with 64bit Windows.(Thanks trancexx)

Updated 3-5-2010: Fixed bug that was causing _ThumbBar_CreateButton() to fail when passing it an icon handle. I was using function IsHwnd() to verify icon was a handle when I should have been using IsPtr().

Here is the thumbnail toolbar UDF I have been working on. Hopefully we will start seeing some cool apps that take advantage of these nice new features of Windows 7. As with anything I post, please let me know if you have any problems or suggestions (and I love comments). Requirements are Windows 7 and AutoItObject. All examples are included in zip file. Special thanks to the AutoitObject Team. Please Rate.:mellow:

two questions :

1,can use a ico dll?

2,i use Obfuscator /sf=1, it's wrong,click the button,no msgbox.


Share this post


Link to post
Share on other sites
Beege

two questions :

1,can use a ico dll?

2,i use Obfuscator /sf=1, it's wrong,click the button,no msgbox.

1) yes you can. Look at _WinAPI_ExtractIconEx() function or the example I gave getting the icon from a EXE. Same thing only with a dll you need to specify the index.

2) I cant know what the problem is without seeing any code. Did you Obfuscate one of the examples?

Share this post


Link to post
Share on other sites
gooker

1) yes you can. Look at _WinAPI_ExtractIconEx() function or the example I gave getting the icon from a EXE. Same thing only with a dll you need to specify the index.

2) I cant know what the problem is without seeing any code. Did you Obfuscate one of the examples?

thks.

the second question. i just use your example 1.


Share this post


Link to post
Share on other sites
Beege

thks.

the second question. i just use your example 1.

Make sure Obfuscator is not removing anything from the udf.

Share this post


Link to post
Share on other sites
ngocs2tron

i have 1 error in:

$sIcon = _WinAPI_LoadImage(0, $sIcon, $IMAGE_ICON, 16, 16, $LR_LOADFROMFILE)

$IMAGE_ICON and $LR_LOADFROMFILE not found

Share this post


Link to post
Share on other sites
shanet

This is kool!

Have you considered putting it forward to the AutoIt team to include it in the official package?


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites
Beege

This is kool!

Thank you! Posted Image

Have you considered putting it forward to the AutoIt team to include it in the official package?

No. This couldnt happen until AutoitObject became an offical package. It is possible though. AutoitObject is opening a lot of doors to new code that couldnt be written before.

Share this post


Link to post
Share on other sites
Beege

New rewrite to include all other functions and use new ObjCreateInterface() function. :graduated:

Share this post


Link to post
Share on other sites
trancexx

Your the F****ing Sh**t! :graduated:

Is that good or bad?

Do I emit light by your definition?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Beege

Good is not a strong enough word. superior! Glowing hot! :graduated: Being offically included in autoit I think will bring so many more possiblities to autoit! Seriously awsome work girl!

Share this post


Link to post
Share on other sites
guinness

Don't know how I missed this update Beege. Great work.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Synix

A very nice UDF, been using it for some while now but encountered an issue lately:
When testing my script on XP for legacy reasons, I found out it crashed everytime _ITaskBar_SetProgressValue was called (which XP doesn't support). I know it makes no sense to call a function on XP which doesn't work there, but I didn't want to implement checks for every taskbar function called in my script, since many others are also not supported there but don't crash it.

So I tracked the error down to an incorrect IID, because as I said usually a script won't hardcrash when calling an non-existent object method. You have set the IID of ITaskbarList1 instead of ITaskbarList4 in the UDF, which seems to fully work if you have the correct windows version (I thought method inheritance would only work in the opposite direction).

Changing

$IID_ITaskbarList4 = "{56FDF342-FD6D-11d0-958A-006097C9A090}"

to the correct IID

$IID_ITaskbarList4 = "{c43dc798-95d1-4bea-9030-bb99e2983a1a}"

will prevent the script crashes :)

But I guess with that change all OSes prior to Win 7 won't even support the methods they can natively handle (from ITaskbarList1-3) anymore, so maybe a conditional setting of the IID is neccessary to keep it backwards compatible. Here's a List of IIDs and the minimum required OS versions:

$IID_ITaskbarList = "{56FDF342-FD6D-11d0-958A-006097C9A090}" - Win 2000+

$IID_ITaskbarList2 = "{602D4995-B13A-429b-A66E-1935E44F4317}" - Win XP+

$IID_ITaskbarList3 = "{ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf}" - Win Vista+

$IID_ITaskbarList4 = "{c43dc798-95d1-4bea-9030-bb99e2983a1a}" - Win 7+

The best would be if you'd also set the method list dynamically (more info about the supported methods in MSDN).

Best Regards

Edited by Synix

Share this post


Link to post
Share on other sites
Hidix17

AWESOME!


CVlOH5y.png

Share this post


Link to post
Share on other sites
Deye

When trying to download the UDF from the OP's link

I'm getting: "Error (429)
This account's links are generating too much traffic and have been temporarily disabled!"

tried yesterday and its the same today
any one cares to place a link ..

another thing:
anyone got some implementation of  this: https://msdn.microsoft.com/en-us/library/ff969360.aspx

Share this post


Link to post
Share on other sites
Beege

I updated my post with the original zip. Seems I broke all my dropbox links at one point in the past..

Share this post


Link to post
Share on other sites
Leo1906

Very nice job here Beege! Thanks a lot for your work :)

One thing that don't seem to work is to update the Buttons icon.
I modified your second example to update all button icons, but only the Buttons description text gets updated:

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#region Header

#include <ITaskBarList.au3>
#include <ButtonConstants.au3>
#include <GuiImageList.au3>
#include <StaticConstants.au3>

$hGUI = GUICreate("ThumbBar", 253, 140)
$cbEnabled = GUICtrlCreateCheckbox("Enabled", 33, 48, 73, 19)
$cbHidden = GUICtrlCreateCheckbox("Hidden", 33, 78, 73, 19)
$cbBackground = GUICtrlCreateCheckbox("No BackGround", 123, 48, 97, 19)
$cbDisabled = GUICtrlCreateCheckbox("Disabled", 33, 108, 73, 19)
$cbInteractive = GUICtrlCreateCheckbox("Non Interactive", 123, 78, 91, 19)
$cbDismission = GUICtrlCreateCheckbox("Dismission Click", 123, 108, 91, 19)
$Label1 = GUICtrlCreateLabel("Button Flags", 72, 12, 108, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetState($cbEnabled, $GUI_CHECKED)
GUICtrlSetState($cbEnabled, $GUI_DISABLE)
GUIRegisterMsg($WM_COMMAND, '_MY_WM_COMMAND')
GUISetState(@SW_SHOW)

_ITaskBar_CreateTaskBarObj()

$Wow64 = ""
If @AutoItX64 Then $Wow64 = "\Wow6432Node"
$sPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $Wow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\Advanced\Images"

$hImageList = _GUIImageList_Create()
_GUIImageList_AddBitmap($hImageList, $sPath & "\Green.bmp")
_GUIImageList_AddBitmap($hImageList, $sPath & "\Blue.bmp")
_ITaskBar_SetTBImageList($hGUI, $hImageList)

$but1 = _ITaskBar_CreateTBButton('IE', @ProgramFilesDir & '\Internet Explorer\iexplore.exe')
$but2 = _ITaskBar_CreateTBButton('Left ToolTip', @ScriptDir & '\Icons\Left.ico')
$but3 = _ITaskBar_CreateTBButton('Right ToolTip', @ScriptDir & '\Icons\Right.ico')
$but4 = _ITaskBar_CreateTBButton('Green', -1, 0)
$but5 = _ITaskBar_CreateTBButton('Blue', -1, 1)
$but6 = _ITaskBar_CreateTBButton('AutoIt', @AutoItExe);
_ITaskBar_AddTBButtons($hGUI)

_ITaskBar_SetOverlayIcon($hGUI, @ProgramFilesDir & '\Internet Explorer\iexplore.exe')

While 1
    Switch GUIGetMsg()
        Case $cbHidden, $cbEnabled, $cbBackground, $cbDisabled, $cbInteractive, $cbDismission
            Global $iFlags = $THBF_ENABLED
            If BitAND(GUICtrlRead($cbHidden), $GUI_CHECKED) Then $iFlags += $THBF_HIDDEN
            If BitAND(GUICtrlRead($cbBackground), $GUI_CHECKED) Then $iFlags = BitOR($iFlags, $THBF_NOBACKGROUND)
            If BitAND(GUICtrlRead($cbDisabled), $GUI_CHECKED) Then $iFlags = BitOR($iFlags, $THBF_DISABLED)
            If BitAND(GUICtrlRead($cbInteractive), $GUI_CHECKED) Then $iFlags = BitOR($iFlags, $THBF_NONINTERACTIVE)
            If BitAND(GUICtrlRead($cbDismission), $GUI_CHECKED) Then $iFlags = BitOR($iFlags, $THBF_DISMISSONCLICK)
            For $i = $but1 To $but6;set all buttons the same flag
                _ITaskBar_UpdateTBButton($i, $iFlags, "Pause", @ScriptDir & '\Icons\Left.ico')
                If @error Then ConsoleWrite(_Get_HRESULT_ERROR_STRING(@error) & @CRLF)
            Next
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)

    Local $iMsg = _WinAPI_HiWord($wParam)

    If $iMsg = $THBN_CLICKED Then
        Local $iID = _WinAPI_LoWord($wParam)
        Switch $iID
            Case $but1
                ConsoleWrite('IE Button has been Pressed.' & @CRLF)
            Case $but2
                ConsoleWrite('Left Button has been Pressed.' & @CRLF)
            Case $but3
                ConsoleWrite('Right Button has been Pressed.' & @CRLF)
            Case $but4
                ConsoleWrite('Green Button has been Pressed.' & @CRLF)
            Case $but5
                ConsoleWrite('Blue Button has been Pressed.' & @CRLF)
            Case $but6
                ConsoleWrite('Autoit Button has been Pressed.' & @CRLF)
        EndSwitch
    EndIf

    Return $GUI_RUNDEFMSG

EndFunc   ;==>_MY_WM_COMMAND

 

Edit: My OS is Windows 10 x64

 

Edit2: Ok I found the error. When you give the path of the ico file the function doesn't check if it's already a handle or the plain file. This is the correct function for just passing the ico file:

 

Func _ITaskBar_UpdateTBButton($iButton, $iFlags = -1, $sToolTip = -1, $sIcon = -1, $iBitmap = -1, $sFunctiontoCall = -1, $iMask = -1)

    If Not $g_ITBL_oButtonIDs.Exists($iButton) Then Return SetError(1, 0, 0)
    Local $iIndex = $g_ITBL_oButtonIDs.Item($iButton)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iIndex = ' & $iIndex & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console


    If $sIcon <> -1 Then $g_ITBL_aButtons[$iIndex][$g_ITBL_hIcon] = _WinAPI_LoadImage(0, $sIcon, $IMAGE_ICON, 16, 16, $LR_LOADFROMFILE)
    If $sFunctiontoCall <> -1 Then $g_ITBL_aButtons[$iIndex][$g_ITBL_sCallFunc] = $sFunctiontoCall
    If $iFlags <> -1 Then $g_ITBL_aButtons[$iIndex][$g_ITBL_iFlags] = $iFlags
    If $iBitmap <> -1 Then $g_ITBL_aButtons[$iIndex][$g_ITBL_iBitmap] = $iBitmap
    If $sToolTip <> -1 Then $g_ITBL_aButtons[$iIndex][$g_ITBL_sToolTip] = $sToolTip

    If $iMask <> -1 Then
        $g_ITBL_aButtons[$iIndex][$g_ITBL_iMask] = $iMask
    Else
        __UpdateTBMask($iIndex)
    EndIf

    __SetThumbBarStructData()

    Local $iRet = $g_ITBL_oTaskBar.ThumbBarUpdateButtons($g_ITBL_aButtons[0][$g_ITBL_hGui], $g_ITBL_aButtons[0][0], DllStructGetPtr($g_ITBL_aButtons[0][$g_ITBL_DllStruct]))
    If $iRet Then Return SetError($iRet, 0, 0)
    Return 1

EndFunc   ;==>_ITaskBar_UpdateTBButton

 

Edited by Leo1906

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×