QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The $SCREENHIDE Metacommand can be used to hide the main program window throughout a program.

Syntax

$SCREENHIDE

Example(s)

Hiding a program when displaying a message box in Windows.


$SCREENHIDE
DECLARE DYNAMIC LIBRARY "user32"
  FUNCTION MessageBoxA& (BYVAL hWnd%&, BYVAL lpText%&, BYVAL lpCaption%&, BYVAL uType~&)
END DECLARE
DECLARE DYNAMIC LIBRARY "kernel32"
  SUB ExitProcess (BYVAL uExitCode~&)
END DECLARE
DIM s0 AS STRING
DIM s1 AS STRING
s0 = "Text" + CHR$(0)
s1 = "Caption" + CHR$(0)
ExitProcess MessageBoxA(0, _OFFSET(s0), _OFFSET(s1), 0)

See Also