Results 1 to 2 of 2

Thread: Reading text output of a DOS console (Ms-Dos ProgramRun Prev in Windows Environement)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2008

    Reading text output of a DOS console (Ms-Dos ProgramRun Prev in Windows Environement)

    Reading text output of a DOS console (Ms-Dos Program Run Prev in Windows Environement):

    Well, here we are examining whether it is possible to obtain the console handle of a ms-dos previously run:



    If any know if is possible obtain a Console Handle and Capture the Screen Buffer of a Ms-Dos program already run, with this code, for example???:

    fsuccess = GetConsoleScreenBufferInfo(hConsoleOut, csScreenBuffer)' (This is the Important Code, appear to be that with hConsoleOut is Possible retrieve the Buffer)
    'non-zero result is a success
    ConsoleBoundary = csScreenBuffer.srWindow
    Dim lineMessage As String * 80
    readLength = 80
    XPos = 0
    YPos = 0
    Text1.Text = ""
    For YPos = 0 To ConsoleBoundary.Bottom
    def = ReadConsoleOutputCharacter(hConsoleOut, lineMessage, readLength, YPos * 65536, vbNull)
    If Trim(lineMessage) <> "" Then
    Text1.Text = Text1.Text & Trim(lineMessage) & vbCrLf
    End If
    Next YPos

    Appear to be the problem is retrieve the Console Handle of a Ms-Dos program that exist previously...

    Is possible your contribution to this interesting problem???

    Sorry for nuisances and thanks in advance!!!

    Good day...

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™

    Re: Reading text output of a DOS console (Ms-Dos ProgramRun Prev in Windows Environement)

    Thread Moved

    Did you check Joacim's FAQ on it?

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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