Page 1 of 1

window With no Title And With no taskbar icon?

Posted: Tue Jul 29, 2025 9:47 am
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)

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

Posted: Tue Jul 29, 2025 10:25 am
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

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

Posted: Tue Jul 29, 2025 10:56 am
by Realizimo
Thank you very much, but it's hard to understand what you did.

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

Posted: Tue Jul 29, 2025 11:50 am
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

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

Posted: Tue Jul 29, 2025 12:52 pm
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.

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

Posted: Tue Jul 29, 2025 1:33 pm
by AZJIO

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

Posted: Tue Jul 29, 2025 1:54 pm
by Realizimo
Now I understand, thanks everyone

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

Posted: Tue Jul 29, 2025 3:15 pm
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

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

Posted: Tue Jul 29, 2025 3:26 pm
by JHPJHP
Post removed; off topic.

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

Posted: Tue Jul 29, 2025 4:29 pm
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

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

Posted: Tue Jul 29, 2025 4:56 pm
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)

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

Posted: Sat Aug 02, 2025 10:02 am
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