Share via


Creating Message Handlers for the Property Sheet Elements

You need to add handlers to the design elements you have placed on the property page.

Dd435762.wedge(en-us,MSDN.10).gifTo create the message handlers

  1. Double-click a design element on the property page. The following dialog box displays.

    Dd435762.mmc3(en-us,MSDN.10).png

  2. Select the design element name from the Class or object to handle list (for example, IDC_VIRUS_STRING).

  3. Select the name of the event you want to handle (for example, the EN_CHANGE event).

  4. Click the Add and Edit button – this will generate the needed method specification and let you edit the code. For example, if you use the IDC_VIRUS_STRING design element and the EN_CHANGE event, the following code will be generated:

    LRESULT OnChange_VirusString(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
        {
            // TODO : Add Code for control notification handler.
            return 0;
        }
    
  5. You would like, at least, to enable the Apply button whenever a change to any of the controls is made. To do so you need to add the following code to the message handler:

        // Enable the Apply button
        SetModified();
    

Send comments about this topic to Microsoft

Build date: 6/30/2010