getting text from WinXP console

Jeff Shannon jeffshannon at gmail.com
Tue Mar 22 02:56:29 CET 2005


Peter Hansen wrote:

> Jeff Shannon wrote:
> 
>> Unless I'm seriously mistaken, the only way that this will be possible 
>> is if there's a Win32 API call that will give the correct information. 
>>  This might be possible to find in the MSDN documentation, if it 
>> exists, but I suspect that it probably doesn't.
> 
> Just thinking: in NT, XP, and friends, the "DOS" console has
> a scrollback buffer.  In addition, even in 98 you can cut and
> paste text in a console window.  Both of these are clear
> evidence that the data is available.  Whether the API to get
> to it is well-documented and available remains to be
> answered... I'm guessing it is, somewhere...

Hm, that's a good point.  It may even be possible to simulate 
selecting the entire console window and copying the text to the 
clipboard, and from there into the capturing application.  It might be 
worth exploring win32ui & friends...

Jeff Shannon




More information about the Python-list mailing list