Jump to content

ITaskBarList UDF - Rewrite for Beta All Methods Included


Beege
 Share

Recommended Posts

Woo this is awesome Posted Image

Very good job there!

James

Thankyou! Glad to hear you liked it :(

Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

thks.

the second question. i just use your example 1.

Make sure Obfuscator is not removing anything from the udf.

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 9 months later...

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 3 years later...
  • 1 year later...

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

Link to comment
Share on other sites

  • 7 months later...

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...