Click to See Complete Forum and Search --> : Dialog Handle


August 18th, 1999, 01:56 AM
Hi everybody,

How do I get the handle of a Dialog template. For example I have a dialog with an ID IDD_NEW_DIALOG and I need to get the CWnd* handle of this dialog. How will I do that. Please some one Help me out of this problem.

Thanks & Regards,
Bala.

August 18th, 1999, 02:27 AM
Hi Bala,

you can try:

CWnd* pWnd = GetDlgItem(IDD_NEW_DIALOG);
HWND hWnd = pWnd->m_hWnd;


Milan

August 18th, 1999, 02:42 AM
Hi Milan,
I must correct you:
The GetDlgItem function retrieves the handle of a control in the specified
dialog box, not the handle of a dialog box.

Bala you can retrieves the handle of your dialog box if you create or modal your dialog, and if you do this you allready hava a variable of type CMyDialog

Let me know if this help u
Regards,
Burlacu Ovidiu