command line application - get text
-
Hello, I have a command line application – developed by someone else and I need to be able to get the text from it (at some point that application writes in the command line window that a task is completed and I need to know when that occurs). I am able to find the window by the
GetWindowText
returns me the window name – which I already use for finding the window and the::SendMessage(hwnd,EM_SETSEL,0,-1); //start selecting ::SendMessage(hwnd,WM_COPY,0,0); ::SendMessage(hwnd,EM_SETSEL,-1,0); //end selecting if (!IsClipboardFormatAvailable(CF_TEXT)) return TRUE; if (! ::OpenClipboard(NULL)) return TRUE; hglb = GetClipboardData(CF_TEXT);
is not working. If anyone knows a way to solve this problem – please let me know. Thanks. -
Hello, I have a command line application – developed by someone else and I need to be able to get the text from it (at some point that application writes in the command line window that a task is completed and I need to know when that occurs). I am able to find the window by the
GetWindowText
returns me the window name – which I already use for finding the window and the::SendMessage(hwnd,EM_SETSEL,0,-1); //start selecting ::SendMessage(hwnd,WM_COPY,0,0); ::SendMessage(hwnd,EM_SETSEL,-1,0); //end selecting if (!IsClipboardFormatAvailable(CF_TEXT)) return TRUE; if (! ::OpenClipboard(NULL)) return TRUE; hglb = GetClipboardData(CF_TEXT);
is not working. If anyone knows a way to solve this problem – please let me know. Thanks. -
Is this article of any use http://www.codeproject.com/useritems/ConsoleAdapter.asp[^]
nave