Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Removing window from windows task bar.. is there way ?


  • Please log in to reply
16 replies to this topic
Fuco
  • Members
  • 49 posts
  • Last active: Oct 24 2008 06:21 PM
  • Joined: 21 Mar 2006
so is there some way to remove title from task bar ?? For example i dont want to have winamp on task bar. PLS help

also where can i find list of styles & exstyles ? ( i think that not all are in readme )

thx

i found this
How to Hide / Show Taskbar buttons ?
http://www.autohotke... ... 8698#68698

but i only want to remove single button.... pls help

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

so is there some way to remove title from task bar ?? For example i dont want to have winamp on task bar


I'm still searching for a way! I am also interested.

where can i find list of styles & exstyles ? ( i think that not all are in readme )


This is a long list which has been very helpful to me : http://www.angelfire.com/ultra2/rajat/messages.txt

Regards, :)
kWo4Lk1.png

not-logged-in-daonlyfreez
  • Guests
  • Last active:
  • Joined: --
This subject seems to be difficult, this link may be a lead to hiding the taskbar button for non-AHK applications:

A tool to order the window buttons in your taskbar

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Short answer: The solution might be at http://www.autohotke...opic.php?t=5411

Long answer: I recall only two ways to remove a taskbar button (other than hiding the window, of course): 1) The WS_EX_TOOLWINDOW style; 2) making the window owned by another window (probably possible only upon creation of the window, but it might be enough to call the API's SetParent).

Here's a few topics:
http://www.autohotke...opic.php?t=8943
http://www.autohotke...opic.php?t=6705
http://www.autohotke...opic.php?t=6191

You could also try searching for others via keywords WS_EX_TOOLWINDOW and/or SetParent.

Fuco
  • Members
  • 49 posts
  • Last active: Oct 24 2008 06:21 PM
  • Joined: 21 Mar 2006
ok thanx u all, thats what i need :)

//thx

Rnon
  • Guests
  • Last active:
  • Joined: --
Sorry for opening an old thread thought it's still better than opening a new one on the same subject).

I was wondering if any change was recently made.
Chris wrote:

I recall only two ways to remove a taskbar button (other than hiding the window, of course)


It's not the only thread explaining that when hiding a window, it's taskbar button SHOULD disappear (Chris was even explaining why it should).

However, when I run the folloing code:
#singleinstance FORCE
Run, c:\stupid_fax\stupidfax.exe
WinWaitActive, StupidFax
WinHide, ahk_class TMain
WinHide,ahk_class TStandardFaxDisplay

I can ALWAYS see the Taskbar button showing (and enable user to right click it).
BTW, Chris was saying that the reason that the button should be missing while window is hidden is to avoid user from reopening it by pressing the taskbar button.

Not sure if it's a change that was made recently or behavior of the program that I'm trying to hide.
The windows are NOT MsgBox, main window, InputBox, SplashText, SplashImage, etc. - normal windows (as far as I can tell)
** adding it because in another thread, Chris was saying:

If you mean a permanent taskbar button, is your script displaying a window or dialog? In other words, to what window does this taskbar button belong: MsgBox, main window, InputBox, SplashText, SplashImage, etc.?

The only time there should be a taskbar button is when one of the above window types is visible. Some of those types have ways to avoid the taskbar button.



Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
Assuming you're on XP, it's simple. They are just toolbar buttons.
So, you can hide/show them using TB_HIDEBUTTON message, even delete them using TB_DELETEBUTTON.
This script may be of help:
http://www.autohotke...topic17314.html

Although it's written for trayicons, it can be applied to task buttons too, replacing ToolbarWindow321 there with the relevant one, most likely ToolbarWindow322.

Rnon
  • Guests
  • Last active:
  • Joined: --
Thanks,

Looks nice
Though....
1. It's not working to me (maybe I did something wrong)
** I did change the AHK_class to the relevant class and I did try using ToolbarWindow322 AND ToolbarWindow321 - none of them did the trick
*** I do see some times the toolbarWindow321 in my spy, not in taskbar button though.

2. What I was actually asking is: how come.... what's wrong here and how come I hide a window (and another one opened by it) and still I'm left with the taskbar button...
Didn't anyone tell it it wasn't suppose to be there?

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

1. It's not working to me (maybe I did something wrong)
** I did change the AHK_class to the relevant class and I did try using ToolbarWindow322 AND ToolbarWindow321 - none of them did the trick
*** I do see some times the toolbarWindow321 in my spy, not in taskbar button though.

Looks like you have additional toolbars like quick launch etc.
In my case, trayicons toolbar is always the first one, so, ToolbarWindow321.
However, task-buttons toolbar is always the last one, so, it can vary like
ToolbarWindow322, or ToolbarWindow323, etc.
You must check it with WinSpy tool.

2. What I was actually asking is: how come.... what's wrong here and how come I hide a window (and another one opened by it) and still I'm left with the taskbar button...
Didn't anyone tell it it wasn't suppose to be there?

Looks like the app is written in Delphi.
Delphi apps usually behave differently than other ones.
For example, they usually have zero-sized window positioned at the center of the screen, with the class name TApplication mostly.

So, you have to check first which window the task button of the app is attached to.
You can use the above mentioned script to retrieve the infos, assuming you changed ToolbarWindow321 with the correct ToolbarWindow32n. Use

TrayIcons()


Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
I adopt the mentioned script to be used with task buttons.
http://www.autohotke...pic.php?t=18652

You may use it to see which window is bound to the task button of your app.

Rnon
  • Guests
  • Last active:
  • Joined: --
Impressed and confused :lol:

finally got your first answer....

- My taskbar is indeed toolbarWindow322
- your second script retrieved the info of my quick launch (by default I mean - before changes to the 32n)
- I do get now the info about all taskbar buttons
- looks like the application I'm using was written in Delphi - I could see some signs before and I did find the TApplication you were talking about
- I'm not yet sure how to use the information I've retrieved by your script - working on it

Do I use the info about the window's button to SendMessage? (TB_HIDEBUTTON)
A tittle confused still about it...

But most important, would it be a generic solution? I mean, would the .exe file I can make run correctly on any toolbar style (W, W/O quick launch) and work on any NT OS?

Assuming you're on XP, it's simple.

simple to retrieve information and fix it for all or... to fix it for my current computer with the current taskbar settings?

Thanks

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

- your second script retrieved the info of my quick launch (by default I mean - before changes to the 32n)

OK, I'll update this script too at the weekend.

- I'm not yet sure how to use the information I've retrieved by your script - working on it

You can filter out so as to obtain only the needed one, like

TaskButtons("appname.exe")

Do I use the info about the window's button to SendMessage? (TB_HIDEBUTTON)
A tittle confused still about it...

You need idn (:identifier) from the result, then

HideButton(idn, True) ; hide the button
HideButton(idn, False) ; show the button
Or, you may just apply the WinHide function with the hWnd from the result, or using Class(name) if it's unique for the window only.

But most important, would it be a generic solution? I mean, would the .exe file I can make run correctly on any toolbar style (W, W/O quick launch) and work on any NT OS?

I'm aware that older versions of Windows used to use for the task buttons SysTabControl32 control than ToolbarWindow32 control.
However, I don't know from which version of Windows it's changed to ToolbarWindow32 control.
So, if the Windows uses SysTabControl32 for the task buttons, this script won't work there. You may adapt it to work with SysTabControl32, though.

Rnon
  • Guests
  • Last active:
  • Joined: --
Not sure it would work to me.

I get to the point where (modifying your script a little), I filter the info from other taskbar buttons and I get the right idn value (also msgboxed it to be sure it's the right one.
Then, the
HideTrayIcon(idn, bHide = True)
{
   SendMessage, 0x404, idn, bHide, ToolbarWindow322, ahk_class Shell_TrayWnd   ; TB_HIDEBUTTON
   SendMessage, 0x1A, 0, 0, , ahk_class Shell_TrayWnd
}
should hide the relevant button (to my best knowledge) BUT either I'm doing something wrong or it is just not working to me.

I was also trying to run
   msgbox, idn=%idn%
   SendMessage, 0x404, idn, bHide, ToolbarWindow322, ahk_class Shell_TrayWnd   ; TB_HIDEBUTTON
   SendMessage, 0x1A, 0, 0, , ahk_class Shell_TrayWnd
Just after I return idn value from the main function
I do get to see the message box with idn=9 and I did run several tests to see that the right line

sTrayIcons .= A_Index . " | Process: " . sProcess . " | Class: " . sClass . " | hWnd: " . hWnd . " | hIcon: " . hIcon . " | nMsg: " . nMsg . " | uID: " . uID . " | idn: " . idn . "`n" . " | Tooltip: " . sTooltip . "`n"


is the line that I need (and filter to be the only one and the one I get my idn value from) - with Class:TApplication
nothing

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

should hide the relevant button (to my best knowledge) BUT either I'm doing something wrong or it is just not working to me.

I'm afraid that it's the app's characteristic. I mean, the taskbar is constantly updated, so once hiding the button does not guarantee the app's task button remains hidden until it's closed.
To see this, try this. Run notepad.exe, then hide the corresponding button.
After that try to minimize and restore notepad. The button remains still hidden. Fine.
But, then try to hide and re-show the notepad window. Then, you will see the button of the notepad again. But, this button is not the one you hided before which I believe was destroyed when you hide the window.

Have you tried WinHide function, BTW? I suppose this would be the best solution in this case.

rnon
  • Guests
  • Last active:
  • Joined: --
Thanks,

1. the bad news is that for some reason, I was playing with your original script and still couldn't hide the notepad button
2. good news, it could still be working for my app
3. another good news (if I did get you right this time) we can also check OS version and modify it to work with all OS (either using SysTabControl32 or ToolbarWindow32)