C#+MFC添加修改windows窗口系统菜单
自己有修改菜单的需求,但是作为一个刚接触编程不久的小白在修改系统菜单这方面很吃力,最终是做了增加删除的效果但是还有子菜单和图标的问题没有解决,记录一下,效果图:
- C#
- 常用 API函数大全http://blog.youkuaiyun.com/zoojingoo/article/details/49915117#6-api之菜单函数
- 用P/Invoke调用动态链接库中非托管函数
- C# 重写WndProc 拦截、发送系统消息http://www.cnblogs.com/lanmiao/articles/2238236.html
代码块
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace 自定义窗口1
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
[DllImport("user32.dll")]
private static extern bool Inse