调用API AppendMenu ,具体看后面的代码.
------------------------------------
[DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);[DllImport("user32.dll")]
private static extern bool AppendMenu (IntPtr hMenu, Int32 wFlags, Int32
wIDNewItem, string lpNewItem);public const Int32 WM_SYSCOMMAND = 0x112;
public const Int32 MF_SEPARATOR = 0x800;
public const Int32 MF_STRING = 0x0;
public const Int32 IDM_ABOUT = 1000;private void Form1_Load(object sender, System.EventArgs e)
{
    IntPtr sysMenuHandle = GetSystemMenu(this.Handle, false);
    AppendMenu(sysMenuHandle, MF_SEPARATOR, 0, string.Empty);
    AppendMenu(sysMenuHandle, MF_STRING, IDM_ABOUT, "About...");
}protected override void WndProc(ref Message m)
{
    if(m.Msg == WM_SYSCOMMAND)
        switch(m.WParam.ToInt32())
        {
            case IDM_ABOUT :
                MessageBox.Show("This is About dialog");
                return;
            default:
                break;
        }
    base.WndProc(ref m);
}

解决方案 »

  1.   

    using System.Runtime.InteropServices;[DllImport("user32.dll")]
    private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);[DllImport("user32.dll")]
    private static extern bool AppendMenu (IntPtr hMenu, Int32 wFlags, Int32
    wIDNewItem, string lpNewItem);public const Int32 WM_SYSCOMMAND = 0x112;
    public const Int32 MF_SEPARATOR = 0x800;
    public const Int32 MF_STRING = 0x0;
    public const Int32 SC_ABOUT = 1000;private void Form1_Load(object sender, System.EventArgs e)
    {
        IntPtr sysMenuHandle = GetSystemMenu(this.Handle, false);
        AppendMenu(sysMenuHandle, MF_SEPARATOR, 0, string.Empty);
        AppendMenu(sysMenuHandle, MF_STRING, SC_ABOUT, "&About...");
    }protected override void WndProc(ref Message m)
    {
        if(m.Msg == WM_SYSCOMMAND)
            switch(m.WParam.ToInt32())
            {
                case SC_ABOUT :
                    //TODO
                    MessageBox.Show("This is About dialog");
                    break;
            }
        base.WndProc(ref m);
    }