home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / xbasic / xbpro.exe / xb / aconsole.x < prev    next >
Text File  |  1996-01-19  |  2KB  |  74 lines

  1. '
  2. ' ####################
  3. ' #####  PROLOG  #####
  4. ' ####################
  5. '
  6. PROGRAM    "aconsole"
  7. VERSION    "0.0001"
  8. '
  9. IMPORT    "xst"
  10. IMPORT    "xgr"
  11. '
  12. ' This program shows how to get the grid number of the standard console
  13. ' grid and how to hide and display the standard console.
  14. '
  15. ' If you start the program development environment or a standalone
  16. ' executable with a "-HideConsole" command line argument, then the
  17. ' standard console will not be displayed after it is created by
  18. ' startup code.  The code in this program will still display and
  19. ' hide the standard console when suppressed with "-HideConsole",
  20. ' and any program can display a hidden console by sending it a
  21. ' "ShowWindow" or "DisplayWindow" message - see XstGetConsoleGrid().
  22. '
  23. ' If you start the program development environment or a standalone
  24. ' executable with a "-NoConsole" command line argument, then the
  25. ' standard console will not be created or displayed.  In this case
  26. ' there is no standard console grid and therefore it is impossible
  27. ' to send messages to the standard console grid or to display the
  28. ' standard console at any time.  The standard console grid can only
  29. ' be created at startup time, so do not include "-NoConsole" in the
  30. ' command line in any program that may need the standard console at
  31. ' any time.
  32. '
  33. DECLARE FUNCTION  Entry ()
  34. '
  35. '
  36. ' ######################
  37. ' #####  Entry ()  #####
  38. ' ######################
  39. '
  40. FUNCTION  Entry ()
  41. '
  42.     XstGetConsoleGrid (@grid)
  43.     PRINT "console grid = "; grid
  44.     XgrMessageNameToNumber (@"HideWindow", @#HideWindow)
  45.     XgrMessageNameToNumber (@"DisplayWindow", @#DisplayWindow)
  46. '
  47.     IF grid THEN
  48.         XgrSendMessage (grid, #HideWindow, 0, 0, 0, 0, 0, 0)
  49.         XgrProcessMessages (-2)
  50.         XstSleep (500)
  51. '
  52.         XgrSendMessage (grid, #DisplayWindow, 0, 0, 0, 0, 0, 0)
  53.         XgrProcessMessages (-2)
  54.         XstSleep (500)
  55. '
  56.         XgrSendMessage (grid, #HideWindow, 0, 0, 0, 0, 0, 0)
  57.         XgrProcessMessages (-2)
  58.         XstSleep (500)
  59. '
  60.         XgrSendMessage (grid, #DisplayWindow, 0, 0, 0, 0, 0, 0)
  61.         XgrProcessMessages (-2)
  62.         XstSleep (500)
  63. '
  64.         XgrSendMessage (grid, #HideWindow, 0, 0, 0, 0, 0, 0)
  65.         XgrProcessMessages (-2)
  66.         XstSleep (500)
  67. '
  68.         XgrSendMessage (grid, #DisplayWindow, 0, 0, 0, 0, 0, 0)
  69.         XgrProcessMessages (-2)
  70.         XstSleep (500)
  71.     END IF
  72. END FUNCTION
  73. END PROGRAM
  74.