CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Dialog Handle

  1. #1
    Guest

    Dialog Handle

    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.


  2. #2
    Guest

    Re: Dialog Handle

    Hi Bala,

    you can try:

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


    Milan


  3. #3
    Guest

    Re: Dialog Handle

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured