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

    How to get a handle to a dialog

    I have a CFormView based application, and I need to get a handle to the main formview, as well as handles to regular modal dialog boxes. I've never really understood all the stuff about handles, and I can't seem to find out how to get a handle to a dialog in the help.

    Thanks,
    Devin


  2. #2
    Guest

    Re: How to get a handle to a dialog

    Why do you need a handle to dialog? Do you want to access the dialog from another place?


  3. #3
    Guest

    Re: How to get a handle to a dialog

    I'm using a third party software tool from Blue Sky Software called WinHelp Office. You can use this software to create help files for your program, or to create those nifty "What's this?" context menus when users right-click over certain areas in your program.

    To use many of the functions that enable these context menus, you need a handle to the dialog box where the menus will go. I've provided the skeleton of one of the functions below:


    BOOL CSHRegisterDialog(

    HWND a_hDialog, // window handle of the dialog to register
    long a_UniqueID, // unique ID for this dialog
    );

    Parameter
    a_hDialog

    Specifies the dialog box that is being registered.

    Return Value
    If the function succeeds, the return value is TRUE.
    If the function fails, the return value is FALSE. If this function fails What’s This? Help will not be enabled in the specified dialog.
    Remarks
    Example Call:

    case WM_INITDIALOG:

    // Register What's This Help for Duplicate dialog "AboutBox2"
    CSHRegisterDialog(hDlg, (LONG)(55555));
    return (TRUE);


    The hDlg parameter is what I need to get, but I don't know how? Any ideas?

    Thanks
    Devin


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