Results 1 to 4 of 4

Thread: Controlling a remote Dos window

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23

    Question Controlling a remote Dos window

    Hello.
    i need to controll a FULL SCREEN dos window remotly from my vb program.
    i have no problem playing with it turning it to minimized mode, normal size mode, hidden mode
    and also maximized size mode, (i am refering to the maximum dos window size while yu can still se behnd it the desktop)

    i have a problem to handle it on its REAL FULL SIZE mode (like when you press Alt+Enter or change its shortcut properties to FULL SIZE)

    this is what i have:
    -----------------------

    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

    Const SW_SHOWNORMAL = 1
    Const gcClassnameMSWord = "OpusApp"
    Const gcClassnameMSExcel = "XLMAIN"
    Const gcClassnameMSIExplorer = "IEFrame"
    Const gcClassnameMSVBasic = "wndclass_desked_gsk"
    Const gcClassnameNotePad = "Notepad"
    Const gcClassnameMyVBApp = "ThunderForm"

    Public Sub GetClassNameFromTitle()
    Dim sInput As String, hwnd As Long, lpClassName As String
    Dim nMaxCount As Long, lresult As Long
    nMaxCount = 256
    lpClassName = Space(nMaxCount)
    sInput = InputBox("Enter the exact window title:" + Chr$(13) + Chr$(10) + "Note: must be an exact match")
    hwnd = FindWindow(vbNullString, sInput)
    If hwnd = 0 Then
    MsgBox "Couldn't find the window."
    Else
    lresult = GetClassName(hwnd, lpClassName, nMaxCount)
    MsgBox "Window: " + sInput + Chr$(13) + Chr$(10) + "Classname: " + Left$(lpClassName, lresult)

    fActivateWindowClass lpClassName
    End If
    End Sub

    Public Function fActivateWindowClass(psClassname As String) As Boolean
    Dim hwnd As Long
    hwnd = FindWindow(psClassname, vbNullString)
    If hwnd > 0 Then
    ShowWindow hwnd, SW_SHOWNORMAL
    fActivateWindowClass = True
    End If
    End Function

    Private Sub Command1_Click()
    GetClassNameFromTitle
    End Sub


    Please, Any one have an idea ??????????

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23

    Unhappy

    can ay one help me..
    please...

    ?????

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23
    shuld i give up ?

  4. #4
    New Member Martin's Avatar
    Join Date
    Apr 1999
    Location
    Alleroed, Denmark
    Posts
    10

    Re: Controlling a remote Dos window

    Could you perhaps use SendKeys to send the alt+enter combination to the prompt? I haven't tried it myself.
    Martin

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