Page 1 of 1

Window without Title

Posted: Sun Jul 15, 2012 5:23 pm
by J@ckWhiteIII
Hey,
I just wanted to ask if it's possible to open a window with no title (I want to use a borderless window aswell and open a windowed screen after that, so I practically only have a screen). As I said, the window is going to be borderless and with no title bar and a windowed screen = only a small screen.

If anyone knows how to do this..reply please :)

Re: Window without Title

Posted: Sun Jul 15, 2012 5:48 pm
by infratec
Read the help about OpenWindow()

Hint: look at the Flags

Re: Window without Title

Posted: Sun Jul 15, 2012 7:05 pm
by J@ckWhiteIII
I just saw I accidentally clicked on the wrong flag....I had #PB_Window3D_BorderLess...Thanks for the hint. Embarrassing mistake, though...

Re: Window without Title

Posted: Sun Jul 15, 2012 8:05 pm
by Kwai chang caine

Code: Select all

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

Repeat : Delay(1) :Until GetAsyncKeyState_(#VK_ESCAPE)
Escape for end :wink:

Re: Window without Title

Posted: Sun Jul 15, 2012 9:30 pm
by netmaestro
If you're on Windows, here is a version dressed out a bit to allow for the user to move the window around on the screen, close or minimize it and just generally have an expected level of control over it.

Code: Select all

InitSprite()
OpenWindow(0, 200, 200, 195, 260, "PureBasic Window", #PB_Window_BorderLess|#PB_Window_Invisible)
OpenWindowedScreen(WindowID(0),0,0,195,260,0,0,0)

CreatePopupMenu(0)
MenuItem(10, "Minimize")
MenuItem(9, "Close")
MenuItem(8, "Cancel")

ClearScreen(#Blue) ; Creating the window invisible to begin with
FlipBuffers()      ; and then performing this step will prevent
HideWindow(0,0)    ; an annoying flicker when the window opens

quit=0
Repeat
  ev=WindowEvent()
  Select ev
    Case #WM_LBUTTONDOWN
      SendMessage_(WindowID(0),#WM_NCLBUTTONDOWN,#HTCAPTION,0)
    Case #WM_RBUTTONDOWN
      DisplayPopupMenu(0, WindowID(0))
    Case #PB_Event_Menu
      Select EventMenu()
        Case 10
          SetWindowState(0, #PB_Window_Minimize)
        Case 9
          quit=1
      EndSelect
  EndSelect
  ClearScreen(#Blue)
  FlipBuffers()
Until quit