Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove window from taskbar
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)