Window borderless, not draggable?

Just starting out? Need help? Post your questions and find answers here.
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Window borderless, not draggable?

Post by stmdbe2019 »

How do i remove the border? And not draggable?

Code: Select all

; no task bar
; no close, minimise, no maximise, no resise
; no draggable ?
; no border?
Style.l = #PB_Window_BorderLess|#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#DS_3DLOOK 
OpenWindow(#MainWindow, x, y, width, height, "", Style)
-----
Registered PureBasic Coder.
User avatar
Bisonte
Addict
Addict
Posts: 1320
Joined: Tue Oct 09, 2007 2:15 am

Re: Window borderless, not draggable?

Post by Bisonte »

Only

Code: Select all

#PB_Window_BorderLess|#PB_Window_ScreenCentered
This must be enough.

And if you not want to have the window at the center of the screen... only #PB_Window_BorderLess.
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Re: Window borderless, not draggable?

Post by stmdbe2019 »

Sorry. following code with mix of `|#DS_3DLOOK` (hide my application from windows task bar, so that no right click to close it quickly) does not work to apply BORDERLESS is it a BUG?

Code: Select all

#PB_Window_BorderLess|#DS_3DLOOK
-----
Registered PureBasic Coder.
User avatar
Bisonte
Addict
Addict
Posts: 1320
Joined: Tue Oct 09, 2007 2:15 am

Re: Window borderless, not draggable?

Post by Bisonte »

Search at RSBasic's WinAPI Library for : HideWindowFromTaskBar and don't use this flag.

Its not a bug... You are using a constant that is not intended for OpenWindow().
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

Re: Window borderless, not draggable?

Post by mestnyi »

Code: Select all

Debug #DS_3DLOOK ; 4
Debug #PB_Window_Tool ; 4
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Re: Window borderless, not draggable?

Post by stmdbe2019 »

It is impossible to remove the border and make hide from task bar. Tried following combination but failed:

Code: Select all

#PB_Window_Tool|#PB_Window_BorderLess
-----
Registered PureBasic Coder.
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

Re: Window borderless, not draggable?

Post by mestnyi »

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_BorderLess, WindowID(OpenWindow(#PB_Any, 0, 0, 0, 0, "", #PB_Window_Invisible)))
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf
For windows

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_BorderLess)
SetWindowLong_(WindowID(0), #GWL_EXSTYLE,  GetWindowLong_(WindowID(0), #GWL_EXSTYLE) | #WS_EX_TOOLWINDOW)
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf
draggable
http://www.purebasic.fr/english/viewtop ... 13&t=57141
User avatar
Bisonte
Addict
Addict
Posts: 1320
Joined: Tue Oct 09, 2007 2:15 am

Re: Window borderless, not draggable?

Post by Bisonte »

RSBasic's WinApiLibrary says :

Code: Select all

#MainWindow = 1

Procedure HideFromTaskBar(hWnd.i, 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_()
EndProcedure
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

; Your Window
OpenWindow(#MainWindow, 50, 50, 640, 480, "MyProgramm", #PB_Window_BorderLess)
HideFromTaskBar(WindowID(#MainWindow), #True)

Repeat : WaitWindowEvent() : ForEver
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
Post Reply