Difference between revisions of "$SCREENHIDE"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''$SCREENHIDE''' [[Metacommand]] can be used to hide the main program window throughout a program.
The [[$SCREENHIDE]] [[Metacommand|metacommand]] can be used to hide the main program window throughout a program.




{{PageSyntax}}
{{PageSyntax}}
::: $SCREENHIDE
: [[$SCREENHIDE]]




* $SCREENHIDE may be used at the start of a program to hide the main program window when using a [[$CONSOLE|console]] window.  
* $SCREENHIDE may be used at the start of a program to hide the main program window when using a [[$CONSOLE|console]] window.
* $SCREENHIDE must be used before the [[$SCREENSHOW]] [[Metacommand]] can be used!
* The [[_SCREENHIDE]] statement must be used before [[_SCREENSHOW]] can be used in sections of a program.
* The [[_SCREENHIDE]] statement must be used before [[_SCREENSHOW]] can be used in sections of a program.
* '''QB64 [[Metacommand]]s require that commenting or [[REM]] NOT be used!'''
* '''QB64 [[Metacommand|metacommand]]s cannot be commented out with [[apostrophe]] or [[REM]]'''.




''Example:'' Hiding a program when displaying a message box.
{{PageExamples}}
''Example:'' Hiding a program when displaying a message box in Windows.
{{CodeStart}} '' ''
{{CodeStart}} '' ''
{{Cl|$SCREENHIDE}}
{{Cl|$SCREENHIDE}}
Line 25: Line 25:
s0 = "Text" + {{Cl|CHR$}}(0)
s0 = "Text" + {{Cl|CHR$}}(0)
s1 = "Caption" + {{Cl|CHR$}}(0)
s1 = "Caption" + {{Cl|CHR$}}(0)
ExitProcess MessageBoxA(0, {{Cl|_OFFSET (function)|_OFFSET}}(s0), {{Cl|_OFFSET(function)|_OFFSET}}(s1), 0)
ExitProcess MessageBoxA(0, {{Cl|_OFFSET (function)|_OFFSET}}(s0), {{Cl|_OFFSET (function)|_OFFSET}}(s1), 0)
{{CodeEnd}}{{small|Code by Michael Calkins}}
{{CodeEnd}}{{small|Code by Michael Calkins}}




''See also:''
{{PageSeeAlso}}
* [[$CONSOLE]], [[$SCREENSHOW]] {{text|(QB64 [[Metacommand]])}}
* [[$CONSOLE]], [[$SCREENSHOW]]
* [[_SCREENHIDE]], [[_SCREENSHOW]]
* [[_SCREENHIDE]], [[_SCREENSHOW]]
* [[_CONSOLE]]
* [[_CONSOLE]]

Latest revision as of 02:19, 24 January 2021

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


Syntax

$SCREENHIDE


  • $SCREENHIDE may be used at the start of a program to hide the main program window when using a console window.
  • The _SCREENHIDE statement must be used before _SCREENSHOW can be used in sections of a program.
  • QB64 metacommands cannot be commented out with apostrophe or REM.


Examples

Example: 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)

Code by Michael Calkins


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page