Does this program exist for Windows?
February 16, 2008 5:04 AM   Subscribe

Where can I find a Windows program that receives console-redirected text and displays it in a text box?

I've realized I could really use a program that does the following things:

1. The main interface looks like a tabbed text editor; each tab has a plain old GUI text field. You can save and load text files (must support ANSI and UCS-2 little endian, at least). At any given time, one tab is "active" to receive text.
2. You can redirect output from console programs to the active tab--i.e. you can say "dir *.whatever > thingy", and thingy.exe will receive text and pass it on to the main interface, where it will show up in the active tab.
3. Programs can send text to the active tab either by using some simple API (preferably provided as source or as a static library, not as a DLL) or by using a named pipe or something similar.
4. Must be a native Windows program (no Cygwin).
5. Must be small, self-contained (no installation/configuration required), and freely redistributable.

I'm sure there must be many ways to get Emacs to do this, but I'm hoping for something small and specialized. Does something like this exist already?
posted by equalpants to Computers & Internet (4 answers total)
 
Well, it's something that would be pretty easy to write. In win32 you can use the CreateProcess function to specify a handle to the input and output. In java you could use the processbuilder class.
posted by delmoi at 9:22 AM on February 16, 2008


Perhaps it might be more helpful to know what it is you plan to do with it?
posted by Spoonman at 2:22 PM on February 16, 2008


Um, how about this using a pipe?
dir *.whatever | thingy
That way thingy wouldn't have to be a device.
Surely someone has done something like this. If not, it might be a fun little project.
posted by DarkForest at 3:43 PM on February 16, 2008


Response by poster: Spoonman: Well, the one possible use that's been bugging me for the last couple days is for console output that's wider than a console. I have a program where some of the intermediate results are matrices with hundreds of columns, which are damn near impossible to read on the console, and it's annoying to have to send them to a file and open up the file in a text editor (where there are scrollbars) whenever I want to look at them. It'd be really convenient if they could be piped directly into a text box.

Another possible use is printf-style debugging from Windows subsystem programs, which have no console. An extra benefit of this style is that instead of having some deeply nested checkbox or registry entry to turn on debugging output, an application can just check whether this program is running. This makes it easier to get logs from customers when there's a reproducible bug. (We use a similar program at my work for this purpose.)

DarkForest: whoops, my bad (typo); of course that should have been a pipe, not a ">".

I do indeed plan to write this if it doesn't exist already; just wanted to make sure I'm not wasting time reinventing the wheel...
posted by equalpants at 6:13 AM on February 17, 2008


« Older Island Diamonds?   |   Alternatives to Seven jeans? Newer »
This thread is closed to new comments.