Announcement

Collapse
No announcement yet.

How to maximize the console window.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to maximize the console window.

    I can maximize the console window (of a running .EXE
    program) manually by clicking on the full-screen button
    in the console's toolbar. Is there a way to program this
    in--so this particular program runs with the window
    maximized (full screen) whenever it is run?

    ------------------

    #2
    Here's a way to programmatically toggle it with the Keyboard:

    Code:
    #INCLUDE "WIN32API.INC"
    
    FUNCTION PBMAIN() AS LONG
        
        PRINT "TEST"
        WAITKEY$
        
        Keybd_event 0, 0, 0, 0
        Keybd_event %VK_MENU, MapVirtualKey(%VK_MENU, 0), %KEYEVENTF_EXTENDEDKEY, 0
        Keybd_event %VK_RETURN, MapVirtualKey(%VK_RETURN, 0), %KEYEVENTF_EXTENDEDKEY, 0
        Keybd_event %VK_MENU, MapVirtualKey(%VK_MENU, 0), %KEYEVENTF_EXTENDEDKEY OR %KEYEVENTF_KEYUP, 0
        Keybd_event %VK_RETURN, MapVirtualKey(%VK_RETURN, 0), %KEYEVENTF_EXTENDEDKEY OR %KEYEVENTF_KEYUP, 0
        Keybd_event 0, 0, %KEYEVENTF_KEYUP, 0
                
        WAITKEY$
        
        Keybd_event 0, 0, 0, 0
        Keybd_event %VK_MENU, MapVirtualKey(%VK_MENU, 0), %KEYEVENTF_EXTENDEDKEY, 0
        Keybd_event %VK_RETURN, MapVirtualKey(%VK_RETURN, 0), %KEYEVENTF_EXTENDEDKEY, 0
        Keybd_event %VK_MENU, MapVirtualKey(%VK_MENU, 0), %KEYEVENTF_EXTENDEDKEY OR %KEYEVENTF_KEYUP, 0
        Keybd_event %VK_RETURN, MapVirtualKey(%VK_RETURN, 0), %KEYEVENTF_EXTENDEDKEY OR %KEYEVENTF_KEYUP, 0
        Keybd_event 0, 0, %KEYEVENTF_KEYUP, 0
        
        WAITKEY$
        
    END FUNCTION
    ------------------
    Adam Drake
    PowerBASIC

    Comment


      #3
      pb/cc full-screen/windowed mode switching:

      http://www.powerbasic.com/support/pb...ad.php?t=23880


      ------------------
      lance
      powerbasic support
      mailto:[email protected][email protected]</a>
      Lance
      mailto:[email protected]

      Comment


        #4
        Thanks, Adam and Lance, for your replies.
        THE CODE WORKS!!! I had hoped there was just
        a "switch" to set, or something. My .EXE
        program balloons from 27k to 31k to do the
        Library call, but if that's the only way to
        do it, then that's reality. Again, I
        appreciate greatly your excellent & timely help.

        ------------------

        Comment


          #5
          >My .EXE program balloons from 27k to 31k

          The Youth of America are truly spoiled when a 31 Kb Windows EXE is considered "ballooned".


          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎