Board index » delphi » Hiding Taskbar Buttons Of Other Apps

Hiding Taskbar Buttons Of Other Apps

Hello,

I am trying to find a way to read the names of each program that has a
visible button on the taskbar and if it would be possible to hide that
button from within my own program.

Just to be perfectly clear I am talking about the already open apps, not the
quick launch or the tray.

Thanks

 

Re:Hiding Taskbar Buttons Of Other Apps


Quote
>Just to be perfectly clear I am talking about the already open apps, not
the
>quick launch or the tray.

The apps in the tray are OPEN. They are just HIDDEN.
IIf I understand you correctly you want to HIDE other
running apps ?

Make a list using one of the EnumWindow functions.
Then just hide each toplevel window.
You should proably wanna keep the list so you can
later show the ones you want.

Re:Hiding Taskbar Buttons Of Other Apps


Quote
"Chrissie" <eli...@c2i.net> wrote in message

news:S%EK7.11553$pK1.345147@juliett.dax.net...

Quote

> >Just to be perfectly clear I am talking about the already open apps, not
> the
> >quick launch or the tray.

> The apps in the tray are OPEN. They are just HIDDEN.
> IIf I understand you correctly you want to HIDE other
> running apps ?

> Make a list using one of the EnumWindow functions.
> Then just hide each toplevel window.
> You should proably wanna keep the list so you can
> later show the ones you want.

Thanks for the suggestion, but what I wanted was to hide just the taskbar
button of the other programs for right now, any suggestions on that?

Thanks

Re:Hiding Taskbar Buttons Of Other Apps


Use FindWindow (or EnumWindows) to get the handle of the window, then
use ShowWindow

ShowWindow(FoundHandle,SW_HIDE);

Quote
Edward Neller wrote:

> "Chrissie" <eli...@c2i.net> wrote in message
> news:S%EK7.11553$pK1.345147@juliett.dax.net...

> > >Just to be perfectly clear I am talking about the already open apps, not
> > the
> > >quick launch or the tray.

> > The apps in the tray are OPEN. They are just HIDDEN.
> > IIf I understand you correctly you want to HIDE other
> > running apps ?

> > Make a list using one of the EnumWindow functions.
> > Then just hide each toplevel window.
> > You should proably wanna keep the list so you can
> > later show the ones you want.

> Thanks for the suggestion, but what I wanted was to hide just the taskbar
> button of the other programs for right now, any suggestions on that?

> Thanks

--
--------------------------------------
Pirch resources
--
http://pirchworld.com
--------------------------------------

Re:Hiding Taskbar Buttons Of Other Apps


Quote
"Edward Neller" <sk...@si.rr.com> wrote in message

news:uXFK7.122576$n5.15175998@typhoon.nyc.rr.com...

Quote

> "Chrissie" <eli...@c2i.net> wrote in message
> news:S%EK7.11553$pK1.345147@juliett.dax.net...

> > >Just to be perfectly clear I am talking about the already open apps,
not
> > the
> > >quick launch or the tray.

> > The apps in the tray are OPEN. They are just HIDDEN.
> > IIf I understand you correctly you want to HIDE other
> > running apps ?

> > Make a list using one of the EnumWindow functions.
> > Then just hide each toplevel window.
> > You should proably wanna keep the list so you can
> > later show the ones you want.

> Thanks for the suggestion, but what I wanted was to hide just the taskbar
> button of the other programs for right now, any suggestions on that?

enumwindows and hide is fine if you have one or a few apps you specifically
want
to hide
if you do that for an explorer window it hides the window, not just the
button
Explorer also doesn't behave well if you play around with its windows, it
decides
to close hidden windows

you can change the window type to a toolbar, that changes its caption
attributes
and you cannot alt-tab

if you have IE4 or later look up

ITaskBarList

otherwise you need to control the systabcontrol
and manage the ---icons---  yourself, any window with a hidden icon
will have the task manager attempt to show its icon again when the
app changes focus  ( as part of updating the active/selected
taskbar icon/button)

roughly

uses commctrl;

Item: TTCITEM;
OtherProcessItem: PTTCITEM;
h:thandle

FindWindow('Shell_TrayWnd', nil);
follow it down to
h:=FindWindowEx(h, 0, 'SystabControl32', nil);

[ to see how it operates use winsight or other message spy software to
examine
 the messages sent between the  tabcontrol and its owner when
 an application is created/gets focus ]

then
r:=SendMessage(h, TCM_GETITEMCOUNT, 0, 0)

to find how many items on the taskbar

then
if r>0 then  for i := 0 to r-1  do
 if SendMessage(h, TCM_GETITEM, i, LongInt(OtherProcessItem)) <> 0
...
does all that seem just a little too easy ? this is windows afterall

before doing this you need to create memory in the process for the systab
and access it by read/write process memory..otherwise your code just
becomes a nice tool to test your Exploder crash recovery software
:-)

you need to copy your tcitem data into the allocated space, sendmessage then
copy it back
to read the result

the lparam in the TTCITEM is the window handle of the taskbar item
when used with the taskbar systab, for a delphi app this is the hidden
window
for an IE window it will be the actual window

SendMessage(h, TCM_INSERTITEM, i, LongInt(OtherProcessItem))
where  item.lParam is a handle will add that windows app to the tasbar
position #FFFF will put it at rightmost
position 0 will put it leftmost..which will be fun if there is already
another
icon of the same type, two or three cause the tasklist to not behave (non
fatally);-)

SendMessage(h, TCM_DELETEITEM, i, LongInt(OtherProcessItem))
where  item.lParam is a number removes that (0-based) item from the tasklist
as noted before, it will reappear when focus changes to the app again
unless it is hidden or you arrange to control the systab messages
to determine which items you want shown
icons are not necessarily removed by the managemnet system as deleteitem,
usually it
uses eraseregion then redraws those still available

removing the icon still allows alt-tab

one the whole..it isn't worth the effort unless for a very limited app you
know
about and have a good idea exactly when it should be hidden
Also provides said app cannot be hidden using the other methods

One way to 'hide' IE windows without upsetting IE is to kill their icons,
then whip them off
to a far distant land on the desktop.

Other Threads