Jump to content

_TaskBar.au3


Mat
 Share

Recommended Posts

kk, this is called a big workaround.

I was trying to find a way that some programs have a different taskbar text to their title, and I came up with this. I then expanded it to include some useful functions that people ask for quite often like hiding the taskbar. And thats actually just 2 lines of code... It helps when you consider the taskbar to be a window like any other.

No examples just yet, i'm still trying to get some parts to work, on the the whole though, its complete. the project gradually slowed to a halt last tuesday, so I thought I should just release it in the hope it might still be of use to/could be extended by someone else. There is a basic example a few posts below: .

Stuff to do:

* Sort out the sync events. Its not perfect yet, and only handles some events. ("Move" is working now! It was returning RunDefMsg)

* Find a way to inforce aspects of $WS_EX_TOOLWINDOW on the parent without affecting the graphics.

22 functions...

* _TaskBarItemCreate

* _TaskBarItemSetUpSync

* _TaskBarItemRemoveSync

* _TaskBarItemDestroy

* _TaskBarItemSetState

* _TaskBarItemSetStyle

* _TaskBarItemGetStyle

* _TaskBarItemGetState

* _TaskBarItemSetText

* _TaskBarItemGetText

* _TaskBarItemSetIcon

* _TaskBarItemSwitch

* _TaskBarGetHandle

* _TaskBarGetPos

* _TaskBarGetSide

* _TaskBarSetState

* _TaskBarGetState

* _TaskBarSetTrans

* _TaskBarSetStartState

* _TaskBarGetStartState

* _TaskBarSetClockState

* _TaskBarGetClockState

Download

Updated 24/01/11

Mat

Edited by Mat
Link to comment
Share on other sites

2 new functions, to do with the startmenu... I can't find a way to automize the "all programs" bar, according to winfo, its a window with class "basebar", which doesn't like being controlled by me...

anyway:

* _TaskBarSetStartMenuState

* _TaskBarGetStartMenuState

No one interested? no? ah well.

MDiesel

Link to comment
Share on other sites

2 new functions, to do with the startmenu... I can't find a way to automize the "all programs" bar, according to winfo, its a window with class "basebar", which doesn't like being controlled by me...

anyway:

* _TaskBarSetStartMenuState

* _TaskBarGetStartMenuState

No one interested? no? ah well.

MDiesel

im interested ;)

AND

this is Alot of help :D

thankyou :P

if i find out anything in my medeling. i will let you know :D

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

Thanks Thornhunt, it was you who got me to write the second half of these functions in the first place! :D

Still no success automating the "basebar", It doesn't like me.

I fiund out I'm not the first to automate the taskbar in this way, gafrost did... But that was a long time ago, and uses a lot of winapi.au3, whereas mines only include is SendMessage.au3.

MDiesel

Link to comment
Share on other sites

  • 4 weeks later...

A very nice function collection, thank you!

I had to calculate the full desktop area minus taskbar's dimensions. Therefore I needed _TaskBarGetSide() and _TaskBarGetPos().

Feature request: A function to tell whether Autohide is on or off. Maybe the info is found from registry somehow.

Edited by amokoura
Link to comment
Share on other sites

Basic example...

#include<_taskbar.au3>

$hMainUI = GUICreate ("Main Window", 300, 300, -1, -1, -1, 0x00000080)
GUISetIcon (-1, "Shell32.dll", 36)
GUISetState (@SW_SHOW, $hMainUI)
$hTaskItem = _TaskBarItemCreate ("Taskbar Item text!", "shell32.dll", 14)
_TaskBarItemSetState ($TASKSTATE_SHOW, -1)
_TaskBarItemSetupSync ($hMainUI, $hTaskItem)
While GUIGetMsg () <> -3
WEnd

I'll make a full list soon :)

MDiesel

Link to comment
Share on other sites

Basic example...

#include<_taskbar.au3>

$hMainUI = GUICreate ("Main Window", 300, 300, -1, -1, -1, 0x00000080)
GUISetIcon (-1, "Shell32.dll", 36)
GUISetState (@SW_SHOW, $hMainUI)
$hTaskItem = _TaskBarItemCreate ("Taskbar Item text!", "shell32.dll", 14)
_TaskBarItemSetState ($TASKSTATE_SHOW, -1)
_TaskBarItemSetupSync ($hMainUI, $hTaskItem)
While GUIGetMsg () <> -3
WEnd

I'll make a full list soon :)

MDiesel

This does not work!!!
Link to comment
Share on other sites

Are you using the latest version of the udf? I made some changes and didn't post them.

Re download it and then see... cus its working here! and there is no reason I can see for it not working... the internals are all very basic.

MDiesel

C:\Documents and Settings\Jack\Desktop\_taskbar.au3 (95) : ==> Unknown function name.:

_TaskBarItemSetOptions ($nStyle, $hRet)

^ ERROR

Link to comment
Share on other sites

Thanks dantay!

C:\Documents and Settings\Jack\Desktop\_taskbar.au3 (95) : ==> Unknown function name.:

_TaskBarItemSetOptions ($nStyle, $hRet)

^ ERROR

hmm... Did I upload the wrong one then? Give me a sec, the link might be wrong. Becouse Iremember changing that.

MDiesel

Edit: Try re downloading, I need to speak to manadar, as I know I uploaded it, and my log file says I uploaded it a few times recently, about a month ago:

25\06\2009

_TaskBar.au3 - Out of date.

24\06\2009

_TaskBar.au3 - Out of date.

and yesterday, 4 times! It might be the script I wrote, but I doubt it... or I uploaded the wrong thing. I have just manually uploaded it, and it seems to be fine (checked the file, no _TaskbarItemSetOptions in there!), What happened was... is I named it that becouse it essentially controls the conrtext menu for the item, so options seemed appropriate, but thats going to expand when I llok at custom context menus.

Edited by mdiesel
Link to comment
Share on other sites

  • 1 year later...

Just had a little play around with this as it looked interesting there are some errors with Functions missing & Variables but its a case of simply renaming. :)

This is to Fix the problem with "Get The Taskbar Side", as currently it is Returning the wrong side.

ConsoleWrite(_Taskbar_GetSide() & @CRLF)
ConsoleWrite(_Taskbar_GetSideEx() & @CRLF)

Func _Taskbar_GetSide()
    Local $tg_WinGetPos = WinGetPos("[CLASS:Shell_TrayWnd]")
    If Not IsArray($tg_WinGetPos) Then Return SetError(1, 1, "None")

    If $tg_WinGetPos[1] > 0 Then
        Return "Bottom"
    ElseIf $tg_WinGetPos[0] > 0 Then
        Return "Right"
    ElseIf $tg_WinGetPos[2] = @DesktopWidth Then
        Return "Top"
    ElseIf $tg_WinGetPos[3] = @DesktopHeight Then
        Return "Left"
    EndIf
EndFunc   ;==>_Taskbar_GetSide

Func _Taskbar_GetSideEx()
    Local $tg_WinGetPos = WinGetPos("[CLASS:Shell_TrayWnd]")
    If Not IsArray($tg_WinGetPos) Then Return SetError(1, 1, "None")

    If $tg_WinGetPos[1] > 0 Then
        If $tg_WinGetPos[0] > 0 Then Return "Right"
        Return "Bottom"
    EndIf
    If $tg_WinGetPos[2] = @DesktopWidth Then Return "Top"
    Return "Left"
EndFunc   ;==>_Taskbar_GetSideEx

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

I haven't looked at this for a while, but thanks :) I'll take your word for it that you're right, but I don't think I'll be able to edit the files (they're not on my google code page), so I'll have to edit the top post. I'll have to see what's going on as it worked for me (and still does in some programs I use it in).

Geez, I don't even recognise the code as being mine at all.

Mat

Link to comment
Share on other sites

I found it on Google Code >>http://code.google.com/p/m-a-t/downloads/detail?name=Taskbar.zip&can=2&q= And that code is kind of mine with the silly Variable prefix of $tg_

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

I found it on Google Code >>http://code.google.com/p/m-a-t/downloads/detail?name=Taskbar.zip&can=2&q= And that code is kind of mine with the silly Variable prefix of $tg_

Hmmm... Funny I didn't link it at the top of this thread... When I said I didn't recognize my code I wasn't referring to what you'd written at all, but the example earlier in the thread ;)

This is how I have the code in other projects:

Func _TaskBarGetSide()
    Local $aPos = _TaskBarGetPos()
    If $aPos[0] < 10 Then
        If $aPos[1] < 10 Then
            If $aPos[2] > 400 Then Return "Top"
            Return "Left"
        EndIf
        Return "Bottom"
    EndIf
    Return "Right"
EndFunc   ;==>_TaskBarGetSide

I will update the first post now :) Thanks again.

Link to comment
Share on other sites

I will update the first post now :) Thanks again.

That crash at start...

C:\Documents and Settings\Administrateur\Bureau\TaskBar.au3(697,37) : WARNING: $hTaskBarSyncTaskItem: possibly used before declaration.
            If $hWnd = $hTaskBarSyncTaskItem Then
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Administrateur\Bureau\TaskBar.au3(698,36) : WARNING: $hTaskbarSyncItem: possibly used before declaration.
                    _SendMessage($hTaskbarSyncItem,
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Administrateur\Bureau\TaskBar.au3(122,43) : WARNING: $hTaskBarSyncTaskItem: declared global in function only. Prefer top of file.
    Global $hTaskBarSyncTaskItem = $hTaskItem
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Administrateur\Bureau\TaskBar.au3(89,82) : ERROR: __TaskbarPrintDebug(): undefined function.
    If $bTaskBarDebug Then __TaskbarPrintDebug("_TaskBarItemCreate (" & $sText & ")")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Administrateur\Bureau\TaskBar.au3(95,39) : ERROR: _TaskBarItemSetOptions(): undefined function.
    _TaskBarItemSetOptions($nStyle, $hRet)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Administrateur\Bureau\TaskBar.au3 - 2 error(s), 3 warning(s)
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

  • 2 years later...

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...