[DllImport("user32.dll", EntryPoint="GetSystemMenu")]
public static extern int GetSystemMenu (
int hwnd, //this.handle.toint32(),你的窗口句柄
int bRevert //设为false
);
[DllImport("user32.dll", EntryPoint="AppendMenu")]
public static extern int AppendMenu (
int hMenu, //GetSystemMenu返回的值
int wFlags,//MF_STRING设置文字(如果你想添加一个分隔符用MF_MENUBREAK)
int wIDNewItem,//给个标示值(用于你截获消息)
int lpNewItem//菜单文字
);