Link to home
Start Free TrialLog in
Avatar of motorway
motorway

asked on

Getting window pointer of a control

I've placed a text control with ID say IDC_TEST_1. Without using the member variables option, or CEDIT class's Create function how can I get a CWnd pointer for this control.
I know it can be done using CEdit's create function, but is there any way I can get the window pointer provided i only know the ID of the text control?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexFM
AlexFM

CEdit* pEdit;
pEdit = (CEdit*) GetDlgItem(IDC_TEST_1);
Avatar of motorway

ASKER

I want to show a rectangle on the selected text control. How can i do it?
I've tried to show a rectangle over the selected control. But, when I try to move the rectangle using the movewindow() function, the rectangle just disappears. My guess is that I'm not getting the coordinates of the selected control with respect to the dialog containing that control. How can I do it?