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