i dont understand why i cant...
-
i dont understand why i cant get the text from an editbox of a window its a window that was created durring runtime i tryed GetWindowText on a handle to the edit box but it outputs a bank char array is it somehow different for getting text from editboxes that are created during runtime? im pretty sure that the dialog window is created during runtime but i may be mistaken because its not my program that creates it help would be very appreciated thx:)
-
i dont understand why i cant get the text from an editbox of a window its a window that was created durring runtime i tryed GetWindowText on a handle to the edit box but it outputs a bank char array is it somehow different for getting text from editboxes that are created during runtime? im pretty sure that the dialog window is created during runtime but i may be mistaken because its not my program that creates it help would be very appreciated thx:)
-
i dont understand why i cant get the text from an editbox of a window its a window that was created durring runtime i tryed GetWindowText on a handle to the edit box but it outputs a bank char array is it somehow different for getting text from editboxes that are created during runtime? im pretty sure that the dialog window is created during runtime but i may be mistaken because its not my program that creates it help would be very appreciated thx:)
Sample code please :) Here is a piece of my code :
CEdit searchedit; CString srchstrl; searchedit.GetWindowText(srchstrl); // The string to search for
Remember the text is not returned, it is placed in the CString refrence. Elaine :rose: The tigress is here :-D -
Have you tried sending the control an EM_GETTEXTEX message? Here's the link to the the msdn library entry on EM_GETTEXTEX[^] "There is an empty room full of people who think you are creative"
-
i dont understand why i cant get the text from an editbox of a window its a window that was created durring runtime i tryed GetWindowText on a handle to the edit box but it outputs a bank char array is it somehow different for getting text from editboxes that are created during runtime? im pretty sure that the dialog window is created during runtime but i may be mistaken because its not my program that creates it help would be very appreciated thx:)
GetWindowText should work. Post some code to see how you are doing it, and someone may be able to spot the problem. -- jlr http://jlamas.blogspot.com/[^]
-
can u fix this code for me? i dont understand how to use GETTEXTEX
GETTEXTEX gte; ZeroMemory(>e,sizeof(gte)); gte.cb = 512; gte.codepage = CP_ACP; SendMessage(hwnd,EM_GETTEXTEX,(WPARAM)>e,(LPARAM)temp);
From MSDN's documentation for the GETTEXTEX Structure[^]:
"The GETTEXTEX structure contains information about an operation to get text from a rich edit control"
Are you trying this with a rich edit control? Otherwise, I don't think it will work. Try this instead:
const int nBufLen = 512; // or whatever size you want
TCHAR buffer[nBufLen];
SendMessage(0, WM_GETTEXT, nBufLen, (LPARAM) buffer);
// Text should be in buffer now-- jlr http://jlamas.blogspot.com/[^]
-
From MSDN's documentation for the GETTEXTEX Structure[^]:
"The GETTEXTEX structure contains information about an operation to get text from a rich edit control"
Are you trying this with a rich edit control? Otherwise, I don't think it will work. Try this instead:
const int nBufLen = 512; // or whatever size you want
TCHAR buffer[nBufLen];
SendMessage(0, WM_GETTEXT, nBufLen, (LPARAM) buffer);
// Text should be in buffer now-- jlr http://jlamas.blogspot.com/[^]
-
GetWindowText should work. Post some code to see how you are doing it, and someone may be able to spot the problem. -- jlr http://jlamas.blogspot.com/[^]
-
no, i already tried that. the classes of the edit controls im trying to read are UsTextEditPane and Ate32Class if that helps at all
Tim Zorn wrote: no, i already tried that. And...? What was the result? Post some code to see how you are doing it and what specific error you get. -- jlr http://jlamas.blogspot.com/[^]
-
i know im doing it right because it works for titlebars and stuff read the post i made about the classes they are and maybe that will help u help me
Using GetWindowText may not work for windows created in another process, but sending WM_GETTEXT directly should work anyway. -- jlr http://jlamas.blogspot.com/[^]