📄 readme.wzd
字号:
/////////////////////////////////////////////////////////////////////
// Add F1 and Shift-F1 Commands to CMainFrame....
/////////////////////////////////////////////////////////////////////
// 1) Add the following to the message map in your CMainFrame class, below
// the ClassWizard makers:
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
// 2) If your help files won't be installed in the same directory as your
// application's executable, add the following to your application class's
// InitInstance() function:
m_pszHelpFilePath=_tcsdup(_T(
"d:\\somedir\\myhelp.hlp" // the directory and name of your help file
));
// 3) Use the Menu Editor to add a "What's this" command to your Help menu:
Name: &What's this
ID: ID_CONTEXT_HELP
Comment: Display help for clicked on buttons, menus and windows\nHelp
// 4) Use the Toolbar Editor to add a "What's this" tool button with an ID of
// ID_CONTEXT_HELP. You can get a bitmap for this by using the AppWizard to
// create a new project and specify "Context help" in step 4. Then cut the
// bitmap from this new project's toolbar.
// 5) Add a F1 and Shift-F1 virtual keys to the Accelerator table with the
// following ID's:
VK_F1, ID_CONTEXT_HELP, VIRTKEY,SHIFT
VK_F1, ID_HELP, VIRTKEY
// 6) Edit the string table:
a) change AFX_IDS_IDLEMESSAGE's message to "For Help, press F1"
b) add a AFX_IDS_HELPMODEMESSAGE message as:
"Select an object on which to get Help" (for SHIFT-F1 help idle)
// 7) For every dialog template, specify the "Context help" style to turn
// on the "?" button in the caption. Also add a "Help" button to each with
// an ID of ID_HELP.
// 8) For each control in a dialog template, choose the "Help ID" option. This
// creates an ID in the template and lists them in a resource.hm file.
// 9) In each dialog class add a WM_HELPINFO and WM_HELPHITTEST message handlers.
(WM_HELPHITTEST must be added manually):
BEGIN_MESSAGE_MAP(CWzdDialog, CDialog)
//{{AFX_MSG_MAP(CWzdDialog)
ON_WM_HELPINFO()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_HELPHITTEST,OnHelpHitTest)
END_MESSAGE_MAP()
BOOL CWzdDialog::OnHelpInfo(HELPINFO* pHelpInfo)
{
if (pHelpInfo->iContextType == HELPINFO_WINDOW)
{
DWORD helpId = -1;
CWnd* pWnd = GetDlgItem(pHelpInfo->iCtrlId);
if (pWnd)
{
helpId = pWnd->GetWindowContextHelpId();
}
AfxGetApp()->WinHelp(helpId, HELP_CONTEXTPOPUP);
}
// return CDialog::OnHelpInfo(pHelpInfo);
return TRUE;
}
LRESULT CWzdDialog::OnHelpHitTest(WPARAM wParam, LPARAM lParam)
{
DWORD helpId = -1;
// find the window that was clicked
CWnd* pWnd = ChildWindowFromPoint(CPoint(LOWORD(lParam), HIWORD(lParam)),
CWP_SKIPINVISIBLE|CWP_SKIPTRANSPARENT);
if (pWnd)
{
helpId = pWnd->GetWindowContextHelpId();
}
return helpId;
}
// 9) Refer to the RoboHELP appendix in the book for how to create
// a .hlp and .cnt file for your application.
/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -