Jump to content

Remove application from taskbar


xShadowx
 Share

Recommended Posts

AutoItSetOption ( "trayiconhide",1)

OR you can do this they both do the same

#notrayicon

Edited by bob00037
Link to comment
Share on other sites

I dont mean the tray icon, I mean the taskbar "bar".

Like this.

Posted Image

I want to remove that bar (not the actual taskbar, just the program ON the taskbar) and still have it run in the background.

Any ideas?

Edited by xShadowx
Link to comment
Share on other sites

Humm, didnt work for me for some reason.

Edit, op got it. Thanks mate, I shal see if it works for what I want.

Humm. Ok, how would I use it on, lets say, the autoit installer, I cant get it to work. Autoit installer is just an example.

Edited by xShadowx
Link to comment
Share on other sites

Humm, didnt work for me for some reason.

Edit, op got it. Thanks mate, I shal see if it works for what I want.

Humm. Ok, how would I use it on, lets say, the autoit installer, I cant get it to work. Autoit installer is just an example.

You can hide a program from the task bar if it's not visible, and you you don't see child windows on the task bar. So you just create a gui, don't show it so it isn't on the task bar, then make the application a child of that gui.

Here's an example but be careful to press F10 to end the program as instructed if there are any hidden windows when you want to quit.

#include <guiconstants.au3>
#include <constants.au3>
#include <windowsconstants.au3>

Opt("TrayIconHide", 1)

$hGui1 = GUICreate('Parent');this is the 'holder' for hidden apps
;GUISetState();hide the parent from task bar as well or remove comment to show it
MsgBox(262144, 'Hide and Seek', 'To Hide the active window press F8' & @CRLF & 'To bring back the last hidden window press F9' & _
        @CRLF & 'To restore all and quit press F10')
Dim $origparent[20][2], $index = 0
Global $hiddenwindow
HotKeySet("{F8}", "Hide")
HotKeySet("{F9}", "Show")
HotKeySet("{F10}", "Leave")
While 1
;next line not needed, it's just to stop anyone seeing your app is running
    If WinExists("Windows Task Manager") Then WinClose("Windows Task Manager")
    Sleep(100)

WEnd

Func Hide()
    If $origparent[$index][0] <> 0 Then Return
    $title = WinGetTitle("")
    
    If $title = 'Program Manager' Then;caution - this is language dependent I assume
        MsgBox(0, "ERROR", "Can't hide Program Manager")
        Return
    EndIf

    $origparent[$index][1] = WinGetHandle($title)
    $origparent[$index][0] = DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index][1], "hwnd", $hGui1)
    $index += 1

    If UBound($origparent) < $index + 2 Then ReDim $origparent[$index + 5][2]
EndFunc;==>Hide

Func Show()
    If $index = 0 Then Return
    If $origparent[$index - 1][0] = 0 Then Return
    DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index - 1][1], "hwnd", $origparent[$index - 1][0])
    WinActivate($origparent[$index - 1][1])
    $origparent[$index - 1][0] = 0
    $index -= 1
EndFunc;==>Show

Func Leave()
    
    While $index > 0
        Show()
    WEnd
    Exit
EndFunc;==>Leave

Func OnAutoItExit()
    
    Leave()
    
EndFunc;==>OnAutoItExit
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Humm, looks interesting. Ill try it. Could I use this?

http://www.autoitscript.com/forum/index.php?showtopic=83841

Maybe. (It looks easy to use but I don't understand how it works.)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If you want to understand it, look here: http://www.autoitscript.com/forum/index.php?showtopic=82838

//Edit: It#s an example on accessing a COM-Object with AutoIt :mellow:

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

I dont ether. How would I use your script with just one exe? No buttons or anything fancy?

You could make it so that when you press F8 it hides just the window you want to hide, and that's the only window that can be hidden.

Func Hide()
    If $index > 0 Then Return;only one window canm be hidden
    $title = WinGetTitle("")
    
    If $title <> "My WIndow to Hide" then return;put the correct title here.

    $origparent[$index][1] = WinGetHandle($title)
    $origparent[$index][0] = DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index][1], "hwnd", $hGui1)
   $index += 1
EndFunc;==>Hide
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If $title = 'Program Manager' Then;caution - this is language dependent I assume
        MsgBox(0, "ERROR", "Can't hide Program Manager")
        Return
    EndIf
You can make it language independent with:

If WinActive("[CLASS:Progman]") then 
  MsgBox(0, "ERROR", "Can't hide Program Manager")
  Return
EndIf
Link to comment
Share on other sites

I don't think it's Language dependant

I have an Italian version of XP and it's always called Program Manager :mellow:

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

You could make it so that when you press F8 it hides just the window you want to hide, and that's the only window that can be hidden.

Func Hide()
    If $index > 0 Then Return;only one window canm be hidden
    $title = WinGetTitle("")
    
    If $title <> "My WIndow to Hide" then return;put the correct title here.

    $origparent[$index][1] = WinGetHandle($title)
    $origparent[$index][0] = DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index][1], "hwnd", $hGui1)
   $index += 1
EndFunc;==>Hide
So the only thing I have to change is "My WIndow to Hide" text? And where should I put this part of the script, infront of the run command or after, or does it mater?
Link to comment
Share on other sites

So the only thing I have to change is "My WIndow to Hide" text? And where should I put this part of the script, infront of the run command or after, or does it mater?

My script was inteneded to be run as a separate script. Do you want a function that will be included in your own script but let you hide yoiur script? If so, what will determine when it is hidden and when it is shown? A hot key?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

You can make it language independent with:

If WinActive("[CLASS:Progman]") then 
  MsgBox(0, "ERROR", "Can't hide Program Manager")
  Return
EndIf
Thanks ResNullius, I should have thought of that but I didn't.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

My script was inteneded to be run as a separate script. Do you want a function that will be included in your own script but let you hide yoiur script? If so, what will determine when it is hidden and when it is shown? A hot key?

Ah that is why it didnt work. Yes I want the scrip implemented into my script. I just want it hidden, I dont want it shown at all. Would there be a way to activate the script when I run the autoit (so there is no hotkey needed)?

And thanks everyone for your help.

Link to comment
Share on other sites

Ah that is why it didnt work. Yes I want the scrip implemented into my script. I just want it hidden, I dont want it shown at all. Would there be a way to activate the script when I run the autoit (so there is no hotkey needed)?

And thanks everyone for your help.

Well I'm a bit confused now. If you don't want to show your script at all then why have a gui? To prevent the icon in the task bar use

opt("TrayIconHide",1)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Sorry, ok so Im having my script run a program, and there are no silent switches for it, so I want to use what you posted on the other page to hide the box on the taskbar. So ill have my run command, and a script to hide the taskbar box.

Edited by xShadowx
Link to comment
Share on other sites

Sorry, ok so Im having my script run a program, and there are no silent switches for it, so I want to use what you posted on the other page to hide the box on the taskbar. So ill have my run command, and a script to hide the taskbar box.

Do you mean you have a script and it will run programB which has a window and you want to hide the icon for programB and hide programB?

So your scfript can run ProgramB and hide it?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...