Results 1 to 4 of 4

Thread: [RESOLVED] DOS window in Full Screen

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Location
    In the midst of corn, cotton, and beans
    Posts
    185

    Resolved [RESOLVED] DOS window in Full Screen

    First let me say I understand that what I am asking is not reasonable, but the fact of the mater is that people dislike change, and better ways of doing things. So, this is a quest to make people comfortable.

    For my application I call a batch file that runs a DOS program in a CMD window. It works fine except I need the CMD window to start in Full Screen (like the alt+enter hot key). Is there a way to have the window start up like this or is the alt+enter key need to be pressed manually?

    Thanks for any input.
    -RT

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: DOS window in Full Screen

    I don't know of a way to emulate those keys, but this might be acceptable
    Code:
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
    
    Private Declare Function ShowWindow Lib "user32" _
    (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long
    
    Private Const SW_SHOWMAXIMIZED = 3
    
    Private Sub MaximizeDOSWindow(Optional Caption As Variant)
        Dim hwnd As Long
        
        ' if argument is omitted, don't care for window caption
        If IsMissing(Caption) Then Caption = vbNullString
        
        ' find the window
        hwnd = FindWindow("ConsoleWindowClass", Caption) 
    
        If hwnd Then
            ShowWindow hwnd, SW_SHOWMAXIMIZED
        End If
    End Sub
    
    Private Sub Command1_Click()
    MaximizeDOSWindow
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Location
    In the midst of corn, cotton, and beans
    Posts
    185

    Re: DOS window in Full Screen

    This might work but I am using a shell
    so the app is stopping at the shell and not processing any maximize code.

    Is there a way to force the application to continue in the background?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Location
    In the midst of corn, cotton, and beans
    Posts
    185

    Re: [RESOLVED] DOS window in Full Screen

    I set the default CMD window properties to 'Full Screen'

    This was done outside of the program

    While it is resolved for me, I am still curious to find out if there is a way to do it in the application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width