I need to find textBox's user name and password and button in windows form popup.
I found the PopUp id ,but me textBox's inside of element/child that have the same classes and i cant find the specific text box that i need , look at image you will understand.
I have there 8 child with same class and each one have same elemets that i need,itried to find them by child after parament but faild.
int LoginPop = FindWindow(sLoginPopUpClassName, sLoginPopUpName);//found
int LoginPopForm = FindWindowEx(LoginPop, 0, sLoginPopUpClassName, sLoginPopUpName);//found
int LoginPopUserNameArea = FindWindowEx(LoginPopForm, 0, ClassName, sLoginPopUpAreaName);
> LoginPopForm have 8 child with my txtbox's
//here i tried to find my txtBox's and button with child after ,but fail.
int LoginPopUserNameArea = FindWindowEx(LoginPopForm, 7, sClassName, saName);//CtrlNotifySink
int LoginPopPasswordArea = FindWindowEx(LoginPopForm, 8, sClassName, sName);
int LoginPopButtonArea = FindWindowEx(LoginPopForm, 3, sClassName, sName);
int LoginPopTextBoxUserName = FindWindowEx(LoginPopUserNameArea, 0, sClassName, sName);
int LoginPopTextBoxPassword = FindWindowEx(LoginPopPasswordArea, 0, sClassName, sName);
int LoginPopButtonOk = FindWindowEx(LoginPopButtonArea, 0, ClassName, Name);
See this image:
I built a function which goes over all children and finds what I need.
I gebuged FindSpecificWindow and use (SendMessage) to set text and like this I found the place of my element by changed text.
Here it is: