Jump to content

How to hide a taskbar entry but keep the window form?


flxfxp
 Share

Recommended Posts

I'd like to hide the taskbar entry to maximize effective space since the app has a systray icon, i dont need the taskbar entry. The app doesnt allow you to only have a systray instead of both.

How can I hide a taskbar entry but keep the window form?

Thanks,

Dennis

Link to comment
Share on other sites

  • Moderators

flxfxp,

One way is to use the $WS_EX_TOOLWINDOW style:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Test", 500, 500, -1, -1, Default, $WS_EX_TOOLWINDOW)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

But it does mean you lose the icon on the titlebar and only get a small [X] (on Vista at least!).

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

one way is to change the parent to the desktop window which does not have a taskbar button. The problem with this solution is the window will always be behind all other windows...same as the desktop

run("calc")
WinWaitActive("Calculator", "")
$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle("Calculator", ""), "hwnd",  WinGetHandle("Program Manager"))
Link to comment
Share on other sites

one way is to change the parent to the desktop window which does not have a taskbar button. The problem with this solution is the window will always be behind all other windows...same as the desktop

run("calc")
WinWaitActive("Calculator", "")
$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle("Calculator", ""), "hwnd",  WinGetHandle("Program Manager"))

Hey picea892, this works on calculator, but the app in question is Foobar2000, I can't get it working for that program. Changed Calculator handles to foobar2000 but no cigar. Suggestions?
Link to comment
Share on other sites

Hi

You need to use autoit3info to get the correct title of the foobar window. My version may be different, but this works for mine. I have also included how to undo the effect.

$foobar=WinGetHandle("foobar2000 v0.9.6.9", "")
$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $foobar, "hwnd",  WinGetHandle("Program Manager"))
sleep(6000)
$origParent2 = DllCall("user32.dll", "int", "SetParent", "hwnd", $foobar, "hwnd",  $origParent[0])

ps: Open foobar first :)

Edited by picea892
Link to comment
Share on other sites

Hi

You need to use autoit3info to get the correct title of the foobar window. My version may be different, but this works for mine. I have also included how to undo the effect.

$foobar=WinGetHandle("foobar2000 v0.9.6.9", "")
$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $foobar, "hwnd",  WinGetHandle("Program Manager"))
sleep(6000)
$origParent2 = DllCall("user32.dll", "int", "SetParent", "hwnd", $foobar, "hwnd",  $origParent[0])

ps: Open foobar first :)

Awesome! The only problem I have left is that my Window Title changes according to the song, is there a way to be sure that it always grabs correctly?

P.s I use Litestep and it doesn't seem to work in that shell, is there a way to fix this?

Edited by flxfxp
Link to comment
Share on other sites

Hmmm, in these cases I usually use class. Again, need to check with autoit3info to make sure your class is the same

$foobar=WinGetHandle("[CLASS:{97E27FAA-C0B3-4b8e-A693-ED7881E99FC1}]", "")
$origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $foobar, "hwnd",  WinGetHandle("Program Manager"))
sleep(6000)
$origParent2 = DllCall("user32.dll", "int", "SetParent", "hwnd", $foobar, "hwnd",  $origParent[0])
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...