Results 1 to 4 of 4

Thread: DOS Window

  1. #1
    Brian
    Guest

    Talking DOS Window

    How do I close a window which is running a DOS-based program?
    I used 'SHELL' to run a program (ex. PKZIP) but it doesn't allow me to get the window handle so I couldn't close it. Can you guys give me some ideas on how to do this? Thanks a lot!

  2. #2
    Junior Member
    Join Date
    Jan 2002
    Posts
    23
    Public Sub close_remote_window()
    Dim winTitle As String, hwnd As Long

    Const NILL = 0&
    Const WM_SYSCOMMAND = &H112
    Const SC_CLOSE = &HF060&

    'Change winTitle to the title of the window you want to shut.
    'example: winTitle = "Untitled - Notepad"

    hwnd = FindWindow(vbNullString, winTITLE)
    If hwnd <> 0 Then
    hwnd = SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, NILL)
    End If
    End Sub

  3. #3
    Junior Member
    Join Date
    Jan 2002
    Posts
    23

    :-)

    if you will ever find out how to OPEN(Resize) a dos window in to its full size mode..
    that will be great.

  4. #4
    New Member
    Join Date
    Jan 2002
    Location
    Ohio
    Posts
    15

    i'm not sure

    I'm new to api's .. but if u can reference the window for the dos window, can u not send it commands like alt-enter ? that would fullscreen any app. don't flame me, cause i'm just guessing

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