// SystemMenu.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "SystemMenu.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CSystemMenuApp
BEGIN_MESSAGE_MAP(CSystemMenuApp, CWinApp)
ON_COMMAND(ID_APP_ABOUT, &CSystemMenuApp::OnAppAbout)
END_MESSAGE_MAP()
// CSystemMenuApp construction
CSystemMenuApp::CSystemMenuApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// The one and only CSystemMenuApp object
CSystemMenuApp theApp;
// CSystemMenuApp initialization
BOOL CSystemMenuApp::InitInstance()
{
CWinApp::InitInstance();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
// To create the main window, this code creates a new frame window
// object and then sets it as the application's main window object
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
// create and load the frame with its resources
pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
// The one and only window has been initialized, so show and update it
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
HMENU pSysMenu = ::GetSystemMenu(m_pMainWnd->GetSafeHwnd(), FALSE);
if (pSysMenu)
{
::InsertMenu(pSysMenu, 0, MF_BYPOSITION | MF_STRING, ID_SHOW_MESSAGE1, "Show Message 1");
::InsertMenu(pSysMenu, 1, MF_BYPOSITION | MF_STRING, ID_SHOW_MESSAGE2, "Show Message 2");
::InsertMenu(pSysMenu, 2, MF_BYPOSITION | MF_SEPARATOR, 0, "");
}
return TRUE;
}
// CSystemMenuApp message handlers
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// App command to run the dialog
void CSystemMenuApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
// CSystemMenuApp message handlers
没有合适的资源?快使用搜索试试~ 我知道了~
SystemMenu添加Item
共17个文件
h:5个
cpp:4个
vcproj:1个
需积分: 9 4 下载量 89 浏览量
2009-01-06
14:27:55
上传
评论
收藏 2.68MB RAR 举报
温馨提示
修改系统菜单的简单实例代码。。。。。。。。
资源推荐
资源详情
资源评论
收起资源包目录
SystemMenu.rar (17个子文件)
SystemMenu.ncb 9.82MB
resource.h 682B
SystemMenu.aps 46KB
stdafx.h 2KB
SystemMenu.vcproj.NON-8123E1462D1.J_Factory.user 1KB
MainFrm.h 928B
ChildView.cpp 931B
ChildView.h 472B
stdafx.cpp 210B
SystemMenu.sln 884B
SystemMenu.rc 8KB
MainFrm.cpp 3KB
SystemMenu.vcproj 6KB
res
SystemMenu.ico 21KB
SystemMenu.rc2 401B
SystemMenu.h 568B
SystemMenu.cpp 3KB
共 17 条
- 1
资源评论
J_Factory
- 粉丝: 24
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功