Jump to content

Recommended Posts

Posted

I've come across an interesting problem: using WinSetState with @SW_HIDE manages to hide the dialog for the programs I point it at, but it still leaves it's icon in the system tray.

Is there any trick to hide that too?

I'm not looking for a "program specific" method, but more of a general fix.

Thanks much. If I was a bit fuzzy, let me know, I'll do what I can to clarify.

Posted (edited)

Hi,

may try your luck with Systray UDF. Search for it.

#include<Systray.au3>
; Icon verstecken

ConsoleWrite(_SysTrayIconIndex('pidgin.exe') & @CRLF)
_SysTrayIconVisible(1, _SysTrayIconIndex('pidgin.exe'))
Sleep(3000)
_SysTrayIconVisible(0, _SysTrayIconIndex('pidgin.exe'))
_SysTrayIconmove(_SysTrayIconIndex('pidgin.exe'), 0)

Mega

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

Thats exactly what I'm looking for, but I keep getting the following error:

"Error: Could not find toolbar process id, 2"

Any thoughts? Seems to be coming from "_SysTrayIconHandle".

I'm using windows XP (SP 3). Maybe its the new SP?

Posted

gigawatt

Example with notepad:

#include <GuiToolBar.au3>

$NotepadTitle = "Безымянный" ;Change notepad title, because my OS is russian localize

Run("notepad.exe", @WindowsDir, @SW_MINIMIZE)

WinWait("[Class:Notepad]")

$hParent = DllCall("User32.dll", "hwnd", "FindWindow", "str", "Shell_TrayWnd", "str", "")
$hParent = $hParent[0]

$hToolBar = ControlGetHandle($hParent, "", "ToolbarWindow322")

MsgBox(48, "Warning", "Now we hide a Notepad button from taskbar")

$count = _GUICtrlToolbar_ButtonCount($hToolBar)

For $i = 0 To $count - 1
    $ID = _GUICtrlToolbar_IndexToCommand($hToolBar, $i)

    If StringInStr(_GUICtrlToolbar_GetButtonText($hToolBar, $ID), $NotepadTitle) Then
        _GUICtrlToolbar_SetButtonState($hToolBar, $ID, $TBSTATE_HIDDEN)
        ExitLoop
    EndIf
Next

MsgBox(48, "Warning", "Now we show a Notepad button on taskbar")

_GUICtrlToolbar_SetButtonState($hToolBar, $ID, $TBSTATE_ENABLED)
:P
Posted

gigawatt

Example with notepad:

[EDITED OUT]

:P

Thanks much rasim, that seems useful. However, I cant seem to find GUIToolBar.au3 anywhere on the site.

Is there a repository for this .au3 files that I missed?

I found one for the UDFs, but it didn't include this one. Bundled in the new beta maybe?

Posted

Thanks much rasim, that seems useful. However, I cant seem to find GUIToolBar.au3 anywhere on the site.

Is there a repository for this .au3 files that I missed?

I found one for the UDFs, but it didn't include this one. Bundled in the new beta maybe?

:P What the AutoIt version you are using?

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
×
×
  • Create New...