findwindowex and gettext ???
-
private int GetChildHandle(int parent, string className) { int child = FindWindowEx(parent, IntPtr.Zero, className, null); return child; } public void DoExternalWrite(string text) { int parent = FindWindow("obj_Form", "Adobe Creative Suite 2 by cvs/SSG"); int child = GetChildHandle(parent, "obj_BUTTON");// is a group box //in this groupbox there are two text box int child2 = GetChildHandle(child, "obj_EDIT"); SendMessage(child, WM_SETTEXT, IntPtr.Zero, text); } 1 --------- 2 --------- it types mytext to this textbox why ??
thanks for everything i have...
So where is the loop?
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
-
So where is the loop?
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
private int GetChildHandle(int parent, string className) { int childafter=0; while (childafter != null ) { childafter = FindWindowEx(parent, childafter, className, null); } return childafter; } ????????????
thanks for everything i have...
-
private int GetChildHandle(int parent, string className) { int childafter=0; while (childafter != null ) { childafter = FindWindowEx(parent, childafter, className, null); } return childafter; } ????????????
thanks for everything i have...
And?
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
-
And?
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
private int GetChildHandle(int parent, string className) { int childafter = FindWindowEx(parent, 0, className, null); while (childafter != 0 ) { childafter = FindWindowEx(parent, childafter, className, null); listBox1.Items.Add(childafter); } return childafter; } parent takes the hwnd with findwindow() classname i gave when i use that functions, it gives the same . It add to listbox only second textbox hwnd, i am going to crayz ???
thanks for everything i have...
-
private int GetChildHandle(int parent, string className) { int childafter = FindWindowEx(parent, 0, className, null); while (childafter != 0 ) { childafter = FindWindowEx(parent, childafter, className, null); listBox1.Items.Add(childafter); } return childafter; } parent takes the hwnd with findwindow() classname i gave when i use that functions, it gives the same . It add to listbox only second textbox hwnd, i am going to crayz ???
thanks for everything i have...
Why are you adding hwnds to the listbox? I thought you wanted to get text from them.
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
-
Why are you adding hwnds to the listbox? I thought you wanted to get text from them.
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
yes you are right just i wanna see which hwnd i can take just because of this. and always it takes last one hwnd so always takes last one's text
thanks for everything i have...
-
yes you are right just i wanna see which hwnd i can take just because of this. and always it takes last one hwnd so always takes last one's text
thanks for everything i have...
You are returning only the last one. Find text for all the hwnds you get by the loop.
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
-
You are returning only the last one. Find text for all the hwnds you get by the loop.
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
could you help on this? how can i do that?
thanks for everything i have...
-
chieldHwnd= FindWindowEx(parentHwnd, chieldHwnd, "obj_EDIT", null); int length = SendMessage(chieldHwnd, WM_GETTEXTLENGTH, (IntPtr)0, (IntPtr)0); if (length > 0) { StringBuilder sb = new StringBuilder(length); int numChars = SendMessage(chieldHwnd, WM_GETTEXT, (IntPtr)(length + 1), sb); listBox1.Items.Add("in Textbox : " + sb); } this code takes a text in textbox but form has 2 textboxes and it takes last textbox's text how can i get the specified text. username ------------- password ------------- both of them empty and it takes allways password's text of textbox
thanks for everything i have...
Just throwing my 2 cents in... There is one little problem with using WM_GETTEXT to get the string out of textboxes - reliability. There is nothing that says that the control has to respond to that message. There are subclassed textbox classes being used that ignore the WM_GETTEXT message, and hence, return nothing. A password textbox sounds like a good candidate for a customized version of a textbox control that ignores the message, doesn't it?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
could you help on this? how can i do that?
thanks for everything i have...
Well, you get text by sending messages to the control identified by the hwnd, don't you? So send those messages to all the childhwnds you get.
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion