Page 1 of 1

Window without a taskbar button?

Posted: Tue Oct 24, 2006 6:52 pm
by Fluid Byte
I'm writing a system tray application so only the tray icon should be visible and not the button in the Windows taskbar.

Posted: Tue Oct 24, 2006 7:03 pm
by ts-soft
make 2 windows, the first invisible or use this:

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

Posted: Tue Oct 24, 2006 7:30 pm
by Fluid Byte
make 2 windows, the first invisible or use this:
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.

As for the code, this is really a nice piece. Thanks!

Posted: Thu Oct 26, 2006 2:27 pm
by bingo
use "progman" - window as ParentWindowID ... :lol:

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

Posted: Thu Oct 26, 2006 3:54 pm
by Fluid Byte
Oder so. Ist alles gut und erfordert wenig Aufwand. :wink: