Hi everybody.
I would like to build a little encoder application that uses CMD line executeables to do the work.
A problem i havent found a solution to, is how to get the contents of a CMD prompt in progress.
Alltho i TOTAL noob in C++ , i managed to create another .dll application once for a game, that did something like it. (getting text from game console) and it was using WM_GETTEXT
So, i'm convinced that i can use WM_GETTEXT in c++ to get the contents of 8any) window.. but i dont' know exaclty how to.. =/
Any pointers would be highly apreciatedCode:Here's the fundamental stuff of my old similar project #include "dll.h" #include <windows.h> using namespace std; #pragma warning(disable:4129) #define PARENTWND "Console" #define CHILDWND "Edit" #define MAX_BUFFER 16384 #define CR 13 #define LF 10 static HWND hwndParent = NULL; static HWND hwndEdit = NULL; static HWND hwndConsole = NULL; void SetWindowHandles(){ hwndParent = FindWindow(0, PARENTWND); hwndEdit = FindWindowEx(hwndParent, NULL, CHILDWND, NULL); hwndConsole = FindWindowEx(hwndParent, hwndEdit, CHILDWND, NULL); } char* GetTextFromWindow() { SendMessage(hwndConsole, WM_GETTEXT, (WPARAM)sizeof(consolestream), (LPARAM)consolestream); return consolestream; } int main(){ SetWindowHandles(); }
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
There's a possible solution here, but I'm wondering why it is you want to capture the output in the first place. If you want to show progress, then why not just bring the cmd window into the foreground. Or is it for some other reason?
Also, if you're going to be using command line tools for all the work, then why not just write a batch file, rather than diving in to C++. Check out the link in my sig for an example.
Slainte
midders
Because it's ugly? Ugly doesn't bother me but it bothers many people.Originally Posted by midders
Google search for "redirect stdout to a textbox"
Donadagohvi (Cherokee for "Until we meet again")
My Video Tools :: Free Security Software :: Ubuntu Antivirus Rescue CD
Many of the command line tools don't output to stdout or stderr, or at least attempts to redirect these output streams to files in a command window are ineffectual.Originally Posted by freebird73717
If you say so. I guess beauty is in the eye of the beerholder.Originally Posted by jagabo
A quick fix solution would be to run the command line tool in a child window of your main application; then you can move the window around, change it's size and colour etc. however you like.
Similar Threads
-
wildcards in cmd
By cL0N31 in forum ComputerReplies: 6Last Post: 3rd Apr 2009, 21:58 -
a mpg (ffmpeg's mpgs for dvd) joiner app?
By jboyd in forum ffmpegX general discussionReplies: 2Last Post: 8th Feb 2008, 18:05 -
Encoding does not progress/show progress
By protect-ya-neck in forum ffmpegX general discussionReplies: 3Last Post: 20th Jul 2005, 15:49 -
Fire fear prompts Xbox cable swap
By BJ_M in forum Latest Video NewsReplies: 0Last Post: 17th Feb 2005, 12:00 -
CMD 850
By Dr_Layne in forum CapturingReplies: 0Last Post: 25th Jul 2004, 10:55
StatisticsNewest guidesLatest tool updatesNew media comments



Quote