How to retrieve the Child window handle ?????
-
I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function
FindWindowEx()
I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this.HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);
- Window 000E03A2 ""TfrmChat
|- Window 000903D8 ""Tpanel
| |
| -Window 001903D4 ""Tpanel
|- Window 000803C4 ""Tpanel
|
-Window 001903D4 ""TExRichEdit
-
I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function
FindWindowEx()
I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this.HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);
- Window 000E03A2 ""TfrmChat
|- Window 000903D8 ""Tpanel
| |
| -Window 001903D4 ""Tpanel
|- Window 000803C4 ""Tpanel
|
-Window 001903D4 ""TExRichEdit
HWND hChat= FindWindow(_T("TfrmChat"),0); HWND hPanel = FindWindow(_T("TPanel"),0); hPanel = FindWindowEx(hChat,hPanel,_T("TPanel"),0); Of course you might want to check that the first TPanel doesnt actually have the TExRichEdit as its child before looking for the second panel.
-
I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function
FindWindowEx()
I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this.HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);
- Window 000E03A2 ""TfrmChat
|- Window 000903D8 ""Tpanel
| |
| -Window 001903D4 ""Tpanel
|- Window 000803C4 ""Tpanel
|
-Window 001903D4 ""TExRichEdit
-
I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function
FindWindowEx()
I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this.HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);
- Window 000E03A2 ""TfrmChat
|- Window 000903D8 ""Tpanel
| |
| -Window 001903D4 ""Tpanel
|- Window 000803C4 ""Tpanel
|
-Window 001903D4 ""TExRichEdit
try FindWindowEx static CWnd* FindWindowEx( HWND hwndParent, HWND hwndChildAfter, LPCTSTR lpszClass, LPCTSTR lpszWindow );
Sreedhar DV [Real success is having courage to meet failure without being defeated.]
-
This should work HWND hParent = FindWindow(_T("TfrmChat"),0); HWND hChild = FindWindowEx(hParent,0,_T("TPanel"),0); hParent = FindWindowEx(hParent,hChild,_T("TPanel"),0); hChild = FindWindowEx(hParent,0,_T("TExRichEdit"),0);
Thnx a lot.
-
HWND hChat= FindWindow(_T("TfrmChat"),0); HWND hPanel = FindWindow(_T("TPanel"),0); hPanel = FindWindowEx(hChat,hPanel,_T("TPanel"),0); Of course you might want to check that the first TPanel doesnt actually have the TExRichEdit as its child before looking for the second panel.
Thnx a lot