window With no Title And With no taskbar icon?

Just starting out? Need help? Post your questions and find answers here.
Realizimo
User
User
Posts: 71
Joined: Sun Nov 25, 2012 5:27 pm
Location: Sweden

window With no Title And With no taskbar icon?

Post by Realizimo »

Can i get a window With no Title And With no taskbar icon?

Code: Select all

; a window with Title and with no taskbar icon
OpenWindow(0, 1, 1, 115,  70, "xx",#PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Tool)
Delay(1000)
; a window with no Title and with taskbar icon
OpenWindow(0, 1, 1, 115,  70, "xx",#PB_Window_ScreenCentered|#PB_Window_BorderLess)
Delay(1000)
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: window With no Title And With no taskbar icon?

Post by RASHAD »

Code: Select all

OpenWindow(1, -300, 0, 0, 0, "Not Needed", #PB_Window_Invisible)
OpenWindow(0, 1, 1, 115,  70, "xx",#PB_Window_ScreenCentered|#PB_Window_BorderLess)
SetWindowLongPtr_(WindowID(0),#GWL_HWNDPARENT,WindowID(1))
SetWindowColor(0,$9BD6F7)
ButtonGadget(0, 5, 5, 64, 24, "Exit")

Repeat
  Select WaitWindowEvent(1)
    Case #PB_Event_CloseWindow
      Quit = 1
      
    Case #PB_Event_Gadget
       Select EventGadget()
          Case 0
            Quit = 1
       EndSelect
   EndSelect   
Until Quit = 1
Egypt my love
Realizimo
User
User
Posts: 71
Joined: Sun Nov 25, 2012 5:27 pm
Location: Sweden

Re: window With no Title And With no taskbar icon?

Post by Realizimo »

Thank you very much, but it's hard to understand what you did.
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: window With no Title And With no taskbar icon?

Post by Little John »

Rashad's above code a bit simplified, without using API functions:

Code: Select all

OpenWindow(1, -300, 0, 0, 0, "Not Needed", #PB_Window_Invisible)
OpenWindow(0, 1, 1, 115,  70, "xx", #PB_Window_ScreenCentered|#PB_Window_BorderLess, WindowID(1))
SetWindowColor(0, $9BD6F7)
ButtonGadget(0, 5, 5, 64, 24, "Exit")

Repeat
   Select WaitWindowEvent(1)
      Case #PB_Event_CloseWindow
         Quit = 1
         
      Case #PB_Event_Gadget
         Select EventGadget()
            Case 0
               Quit = 1
         EndSelect
   EndSelect   
Until Quit = 1
User avatar
jacdelad
Addict
Addict
Posts: 1993
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: window With no Title And With no taskbar icon?

Post by jacdelad »

Realizimo wrote: Tue Jul 29, 2025 10:56 am Thank you very much, but it's hard to understand what you did.
The window uses an invisible window as parent. The parent has no icon (because it's invisible), the child too (because it's a child to the invisible window, not the desktop).

Just one thought: This could be automated as a flag, either by PureBasic itself or an override procedure with macro.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: window With no Title And With no taskbar icon?

Post by AZJIO »

Realizimo
User
User
Posts: 71
Joined: Sun Nov 25, 2012 5:27 pm
Location: Sweden

Re: window With no Title And With no taskbar icon?

Post by Realizimo »

Now I understand, thanks everyone
User avatar
JHPJHP
Addict
Addict
Posts: 2252
Joined: Sat Oct 09, 2010 3:47 am

Re: window With no Title And With no taskbar icon?

Post by JHPJHP »

Single API function, no second (hidden) window.

Code: Select all

Enumeration
  #MainWindow
  #ButtonGadget
EndEnumeration

If OpenWindow(#MainWindow, 0, 0, 800, 600, "Borderless", #PB_Window_BorderLess | #PB_Window_ScreenCentered | #PB_Window_Invisible)
  ButtonGadget(#ButtonGadget, 50, 50, 100, 50, "Close Window")
  SetWindowLongPtr_(WindowID(#MainWindow), #GWL_EXSTYLE, GetWindowLongPtr_(WindowID(#MainWindow), #GWL_EXSTYLE) | #WS_EX_TOOLWINDOW)
  HideWindow(0, #False)

  Repeat
    Event = WaitWindowEvent()

    Select Event
      Case #PB_Event_Gadget
        Select EventGadget()
          Case #ButtonGadget : Break
        EndSelect
      Case #PB_Event_CloseWindow : Break
    EndSelect
  ForEver
EndIf
Last edited by JHPJHP on Tue Jul 29, 2025 9:38 pm, edited 5 times in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
JHPJHP
Addict
Addict
Posts: 2252
Joined: Sat Oct 09, 2010 3:47 am

Re: window With no Title And With no taskbar icon?

Post by JHPJHP »

Post removed; off topic.
Last edited by JHPJHP on Tue Jul 29, 2025 4:44 pm, edited 1 time in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Realizimo
User
User
Posts: 71
Joined: Sun Nov 25, 2012 5:27 pm
Location: Sweden

Re: window With no Title And With no taskbar icon?

Post by Realizimo »

Here's the context, I chose the pure purebasic version.

Code: Select all

EnableExplicit
LoadFont(1, "Courier", 12)
LoadFont(2, "Courier", 12, #PB_Font_Bold  )

Global f_col=0
Global b_col=$9BD6F7

OpenWindow(1, -300, 0, 0, 0, "Not Needed", #PB_Window_Invisible)
OpenWindow(0, 1, 1, 115,  70, "xx", #PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Invisible, WindowID(1))


ResizeWindow(0, WindowX(0)+120,#PB_Ignore,#PB_Ignore,#PB_Ignore) 
SetWindowColor(0, b_col) 
StickyWindow(0, #True)
CreateImage(0, 16,16,24,#Black)

Global week$
Global Dim weekday$(6)
weekday$(0)="Sunday"
weekday$(1)="Monday"
weekday$(2)="Tuesday"
weekday$(3)="Wednesday"
weekday$(4)="Thursday"
weekday$(5)="Fredag"
weekday$(6)="Saturday"

Procedure.i GetWeek(dateValue.q)
  Protected DayOfWeek , weekNumber  
  ; Get day of week for first day of year (1 = monday, 7 = sunday according to ISO)
  DayOfWeek = DayOfWeek(dateValue)
  If DayOfWeek = 0 : DayOfWeek = 7 : EndIf  
  ; Get week number according to ISO
  weekNumber = (10 + DayOfYear(dateValue) - DayOfWeek) / 7  
  ; Adjust for special cases in ISO
  If weekNumber = 0 ; Date is in week 52 or 53 of the previous year
    weekNumber = GetWeek(Date(Year(dateValue) - 1,12,31,0,0,0))
  ElseIf weekNumber > 52  ; Check if date is in week 1 of next year
    If DayOfWeek(Date(Year(dateValue) + 1,1,1,0,0,0)) <= 4 : weekNumber = 1 : EndIf
  EndIf
  ProcedureReturn weekNumber
EndProcedure

Procedure update_Week()
  Static dayo
;   Debug "c1"
  If dayo=Day(Date()) :ProcedureReturn: EndIf
  dayo=Day(Date()) 
  week$ = Str(GetWeek(Date()))
  ;   week$ = "88"
;   Debug "c2 "+week$
  StartDrawing(ImageOutput(0))
  DrawingFont(FontID(1))
  DrawText(8-TextWidth(week$)/2,0,week$)
  StopDrawing()
  ChangeSysTrayIcon(0, ImageID(0))
  SysTrayIconToolTip(0, "Week: "+week$)
EndProcedure

AddWindowTimer(0, 1, 5000)
AddSysTrayIcon(0, WindowID(0), ImageID(0))
CreatePopupImageMenu(0, #PB_Menu_SysTrayLook)
; MenuItem(0, "About PureBasic...")
; MenuBar()
MenuItem(1, "Exit")
SysTrayIconMenu(0, MenuID(0))
update_Week()

; Debug ColorRequester()
Define hide=1
Repeat
  Select WaitWindowEvent()  
    Case #PB_Event_Menu
      Select EventMenu()
        Case 1 : End
      EndSelect      
    Case #PB_Event_SysTray
      Select EventType()
        Case #PB_EventType_LeftClick,#PB_EventType_LeftClick
          hide!1 : HideWindow(0, hide)
          StartDrawing(WindowOutput(0))
          DrawingFont(FontID(2)) 
          DrawText(8,3 ,"Week: "+week$, f_col,b_col)
          DrawText(8,23, weekday$(DayOfWeek(Date())), f_col,b_col)
          DrawText(8,43, FormatDate("%yyyy-%mm-%dd", Date()), f_col,b_col)
          StopDrawing()
      EndSelect
    Case #PB_Event_Timer : update_Week()
    Case #PB_Event_LeftClick : hide=1: HideWindow(0, hide)

  EndSelect
ForEver
Olli
Addict
Addict
Posts: 1202
Joined: Wed May 27, 2020 12:26 pm

Re: window With no Title And With no taskbar icon?

Post by Olli »

No window title, no taskbar.

Code: Select all

LoadFont(1, "Courier", 12)
LoadFont(2, "Courier", 12, #PB_Font_Bold  )
ExamineDesktops()
InitSprite()
InitKeyboard()
InitMouse()
OpenScreen(DesktopWidth(0), DesktopHeight(0), 32, "")
backColor = $9BD6F7
Repeat
 Delay(1)
 ExamineKeyboard()
 ExamineMouse()
 ClearScreen(backColor)
 StartDrawing(ScreenOutput() )
 DrawingFont(FontId(1) )
 DrawText(0, 0, "Press [ESCAPE] key to quit...", #Black, backColor)
 StopDrawing()
 FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Sergey
User
User
Posts: 54
Joined: Wed Jan 12, 2022 2:41 pm

Re: window With no Title And With no taskbar icon?

Post by Sergey »

Olli wrote: Tue Jul 29, 2025 4:56 pm No window title, no taskbar.
Ha, ha, ha ... really, no title, no taskbar :D
Post Reply