Window without a taskbar button?
Posted: Tue Oct 24, 2006 6:52 pm
I'm writing a system tray application so only the tray icon should be visible and not the button in the Windows taskbar.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Procedure HideFromTaskBar(hWnd.l, Flag.l)
Protected TBL.ITaskbarList
CoInitialize_(0)
If CoCreateInstance_(?CLSID_TaskBarList, 0, 1, ?IID_ITaskBarList, @TBL) = #S_OK
TBL\HrInit()
If Flag
TBL\DeleteTab(hWnd)
Else
TBL\AddTab(hWnd)
EndIf
TBL\Release()
EndIf
CoUninitialize_()
DataSection
CLSID_TaskBarList:
Data.l $56FDF344
Data.w $FD6D, $11D0
Data.b $95, $8A, $00, $60, $97, $C9, $A0, $90
IID_ITaskBarList:
Data.l $56FDF342
Data.w $FD6D, $11D0
Data.b $95, $8A, $00, $60, $97, $C9, $A0, $90
EndDataSection
EndProcedure
Yup. I was thinking of the same just a minute before I read your reply. Pretty obvious but I was to lazy to think about it.make 2 windows, the first invisible or use this:
Code: Select all
If OpenWindow(0,0,0,222,200,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ButtonGadgets",FindWindow_("Progman",0)) And CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 200, 20, "Standard Button")
ButtonGadget(1, 10, 40, 200, 20, "Left Button", #PB_Button_Left)
ButtonGadget(2, 10, 70, 200, 20, "Right Button", #PB_Button_Right)
ButtonGadget(3, 10,100, 200, 60, "Multiline Button (längerer Text wird automatisch umgebrochen)", #PB_Button_MultiLine)
ButtonGadget(4, 10,170, 200, 20, "Toggle Button", #PB_Button_Toggle)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf