• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

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?
0
motorway
Asked:
motorway
  • 2
1 Solution
 
jkrCommented:
In your dialog, you would call

CWnd* pWnd = GetDlgItem ( IDC_TEST_1);
0
 
AlexFMCommented:
CEdit* pEdit;
pEdit = (CEdit*) GetDlgItem(IDC_TEST_1);
0
 
motorwayAuthor Commented:
I want to show a rectangle on the selected text control. How can i do it?
0
 
motorwayAuthor Commented:
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?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now