Page 1 of 1

[done] Window without border and not in Taskbar

Posted: Wed Dec 03, 2014 5:08 pm
by Kukulkan
Hi,

I'm just writing a cross-platform solution and need to show some notifiers on the desktop. I want to open a window for this, but I can not get it to have no border and no entry in the taskbar. Maybe I simply missed a parameter or combination or was there something in the documentation? Maybe a stupid question :|

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_BorderLess)

  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf

  Until Quit = 1
  
EndIf
To get rid of the TaskBar entry, I tried the combination of #PB_Window_BorderLess | #PB_Window_Tool but with no success. In that case, it always gets a border again. Currently working on Windows, but I need it to work in general on all platforms.

Kukulkan

Re: Window without border and not in Taskbar

Posted: Wed Dec 03, 2014 5:20 pm
by Kukulkan
Found a solution for Windows, but how to do for MacOS and Linux???

Windows:

Code: Select all

Window = CreateWindow(...)
SetWindowLong_(WindowID(Window),-20,GetWindowLong_(WindowID(Window),-20)|#WS_EX_TOOLWINDOW)
(I did not find information about that magical -20. What is this value for?)

Kukulkan

Re: Window without border and not in Taskbar

Posted: Wed Dec 03, 2014 5:33 pm
by luis
Kukulkan wrote: (I did not find information about that magical -20. What is this value for?)
It's documented :wink:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Code: Select all

Debug #GWL_EXSTYLE
On linux maybe gtk_window_set_skip_taskbar_hint() ?

https://developer.gnome.org/gtk2/stable ... skbar-hint

It says gtk 2.2 minimum though.

Re: Window without border and not in Taskbar

Posted: Wed Dec 03, 2014 5:43 pm
by IdeasVacuum
You can open an invisible Window as a parent:

Code: Select all

OpenWindow(#DummyWin, -10, -10, 0, 0, "fake parent", #PB_Window_Invisible)
;;;;
OpenWindow(#NotificationWin, 0, 0, 300, 195, "Note Important Info", #PB_Window_BorderLess|#PB_Window_ScreenCentered, WindowID(#DummyWin))

Re: Window without border and not in Taskbar

Posted: Wed Dec 03, 2014 5:58 pm
by Kukulkan
Oh. I'll have to check that parent-feature tomorrow. Sounds good!

Kukulkan

Re: Window without border and not in Taskbar

Posted: Thu Dec 04, 2014 10:22 am
by Kukulkan
The trick with setting a parent window works fine. Thank you!

Kukulkan

Re: [done] Window without border and not in Taskbar

Posted: Thu Dec 04, 2014 3:34 pm
by IdeasVacuum
:mrgreen: I can't take the credit, it was a tip Rashad gave me years ago.