Share via


BaseForm.WndProc(Message) Method

Definition

Reroutes the context-sensitive Help button events to the ShowHelp() method.

protected:
 override void WndProc(System::Windows::Forms::Message % m);
protected override void WndProc (ref System.Windows.Forms.Message m);
override this.WndProc :  -> unit
Protected Overrides Sub WndProc (ByRef m As Message)

Parameters

m
Message

A Message, passed by reference, that represents the requested Help topic.

Examples

The following example reroutes the context-sensitive Help button events to the ShowHelp method and logs calls to the ShowHelp method.

private const int SC_CONTEXTHELP = 0xF180;
private const int WM_SYSCOMMAND = 0x0112;
protected override void WndProc(ref Message m) {

    if ((m.Msg == WM_SYSCOMMAND) &&
        ((int)m.WParam == SC_CONTEXTHELP)) {

        if (CanShowHelp) {
            ShowHelp();
            LogHelpCalls();
        }
    } else {
        base.WndProc(ref m);
    }
}

Applies to