Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove window from taskbar
#1
is it possible to remove a window from the window taskbar without hiding
the window itself ?

thanks
pi
#2
Code:
Copy      Help
;/
function action hwnd ;;action: 1 add, 2 delete

;Adds or deletes taksbar button for window whose handle is hwnd.


interface# ITaskbarList :IUnknown
,HrInit()
,AddTab(hwnd)
,DeleteTab(hwnd)
,ActivateTab(hwnd)
,SetActiveAlt(hwnd)
,{56FDF342-FD6D-11d0-958A-006097C9A090}

ITaskbarList t._create("{56FDF344-FD6D-11D0-958A-006097C9A090}")
t.HrInit
sel action
,case 1 t.AddTab(hwnd)
,case 2 t.DeleteTab(hwnd)

err end _error
#3
thanks.
pi
#4
whenever a deleted window is activated it will show up in the taskbar again.
do i have to use an 'activated window hook' or' do you know a way
to hide the taskbar button permantly.
pi
#5
Use hook or trigger.

Or try this:

SetWindowLong(hwnd GWL_HWNDPARENT GetDesktopWindow)

This removes the taskbar button even without ModifyTaskbar.

Owned windows are not added to taskbar, unless have WS_EX_APPWINDOW exstyle, which can be removed with SetWinStyle.

SetWindowLong(hwnd GWL_HWNDPARENT 0)

will add taskbar button.

Also check if the window is already owned. If yes, just remove WS_EX_APPWINDOW without changing owner. To check it, use if(GetWindow(hwnd GW_OWNER)).
#6
Function TaskbarButton
Code:
Copy      Help
;/
function action hwnd ;;action: 1 add (only if removed), 2 remove

;Deletes or adds (if deleted using this function) taskbar button for window whose handle is hwnd.


int fl
sel action
,case 2
,if(!GetWindow(hwnd GW_OWNER))
,,fl|1
,,SetWindowLong(hwnd GWL_HWNDPARENT GetDesktopWindow)
,if(GetWinStyle(hwnd 1)&WS_EX_APPWINDOW)
,,fl|2
,,SetWinStyle hwnd WS_EX_APPWINDOW 6
,if(fl) SetProp(hwnd "qm_tb_flags" fl)
,
,case 1
,fl=GetProp(hwnd "qm_tb_flags")
,if(fl&1)
,,SetWindowLong(hwnd GWL_HWNDPARENT 0)
,if(fl&2)
,,SetWinStyle hwnd WS_EX_APPWINDOW 5
,RemoveProp hwnd "qm_tb_flags"

Test code
Code:
Copy      Help
int hwnd=win("Notepad") ;;unowned
;int hwnd=win("QM - Threads") ;;owned with WS_EX_APPWINDOW exstyle

TaskbarButton 2 hwnd
3
TaskbarButton 1 hwnd
#7
perfect !!!!

i trigger it with middle click on taskbar button.

function name: middleclick
trigger: #Mh1 //middleclick



Code:
Copy      Help
;\
function# iid FILTER&f
ClearOutput
str cla.getwinclass(f.hwnd)    
str childclass.getwinclass(f.hwnd2)    
if(!f.hwnd2) ret -2

sel _s.getwinexe(f.hwnd) 1
,case "explorer"
,,;out childclass
,,;if(wintest(f.hwnd "" "ExploreWClass")) mac "explorer_get_file"
,,;if(wintest(f.hwnd "" "Progman")) mac "desktop"
,,if(wintest(f.hwnd "" "Shell_TrayWnd"))
,,,;if(childtest(f.hwnd2 "Quick Launch" "ToolbarWindow32" f.hwnd))
,,,,;Acc a=acc(mouse); err ret
,,,,;if(!a.elem) ret ;;not on button
,,,,;str s=a.Name
,,,,;mac "quicklaunch" s
,,,,;ret -1
,,,if(childtest(f.hwnd2 "Ausgeführte Anwendungen" "ToolbarWindow32" f.hwnd))
,,,,Acc a=acc(mouse); err ret
,,,,if(!a.elem) ret ;;not on button
,,,,int mhwnd=win(a.Name)
,,,,TaskbarButton 2 mhwnd

,,,,ret -1
,,
,case "qm"
,,if(wintest(f.hwnd "" "QM_Editor"))
,,,sel GetWinId(f.hwnd2)
,,,,case 2202 mac "qm2202"
,,,,case 2201 ClearOutput
,,,,case 2203 mac "qm_find"
,,,,case 2200 mac "qm_macro_trigger"
,,if _s.getwinclass(f.hwnd)="HH Parent"
,,,mac "_help"        
,,if(wintest(f.hwnd "Find"))
,,,mac "get_macroname"

,,if(wintest(f.hwnd "" "QM_toolbar"))
,,,if(_s.getwintext(f.hwnd)=="DESKBAR")
,,,,mac "qm_deskbar_middle"
,,,;if(_s.getwintext(f.hwnd)=="BBCODE_BAR")
,,,,;_bbcode(2)
,case else ret -2 ;;default action in other programs
pi
#8
in windows 7 it does not work.
do you have an idea why?
pi
#9
int hwnd=win("Notepad") ;;unowned
;int hwnd=win("QM - Threads") ;;owned with WS_EX_APPWINDOW exstyle
TaskbarButton 2 hwnd
3
TaskbarButton 1 hwnd

Tested on 64 bit beta, worked.
#10
Do you have an idea how to do that with UWP apps in Windows 10?
I tried it with Calc (german: Rechner)
I did some research and from what i can find it seems not be supported, but you so often know more.
https://stackoverflow.com/questions/4678...6#46828926

Function Hide_Calc_Taskbar_Button
Code:
Copy      Help
int w=win("Rechner" "ApplicationFrameWindow")

TaskbarButton 2 w
3
TaskbarButton 1 w
pi


Forum Jump:


Users browsing this thread: 1 Guest(s)