我在工程中使用才class wizard加入了一个property sheet控件(wizard类型),如何把它自动生成的help按钮从弹出的对话框中拿掉。
解决方案 »
- hook 别的进程的recv 取远程主机名咋取?可以有偿。
- vc6.0 和 vs2008 冲突问题,xiexie!!
- CListCtrl不能正确显示列宽!
- 请教高手,用Virtual ListCtrl来解决column的hide和display的问题?在线等。提供其他方案也可,高手请进!
- 再提一个简单问题:
- 如何得到“桌面”和“我的文档”的绝对路径,WIN98和WIN 2K都使用的方法。
- 一个很基础的问题,来帮帮忙啊~创建窗口的
- 如何利用CDHTMLDialog 实现打印功能?
- 求VC 数据库编程三部教学源代码
- 送分啊送分!大家来看看!
- 怎样自定义PropertySheet对话框
- 关于画菜单的问题
Property sheets can display two Help buttons: a property sheet Help button that is displayed at the bottom of the frame, next to the OK/Cancel/Apply buttons, and a standard caption bar button that provides context-sensitive Help.The property sheet Help button is optional, and can be enabled on a page by page basis. To display the property sheet Help button for one or more pages:Set the PSH_HASHELP flag in the dwFlags member of the property sheet's PROPSHEETHEADER structure.
For each page that will display a Help button, set the PSP_HASHELP flag in the dwFlags member of the page's PROPSHEETPAGE structure.
When the user clicks the Help button, the active page receives a PSN_HELP notification message. The page must respond by displaying Help information, typically by calling the WinHelp function.Removing the Caption Bar Help Button
The caption bar Help button is displayed by default, so that context-sensitive Help is always available for the OK/Cancel/Apply buttons. However, this button can be removed, if necessary. To remove a property sheet's caption bar Help button:For versions of the common controls prior to version 5.80, you must implement a property sheet callback function.
For version 5.80 and later of the common controls, you can simply set the PSH_NOCONTEXTHELP flag in the dwFlags member of the property sheet's PROPSHEETHEADER structure. However, if you need backward compatibility with earlier common control versions, you must implement the callback function.
To implement a property sheet callback function that removes the caption bar Help button:
Set the PSH_USECALLBACK flag in the dwFlags member of the property sheet's PROPSHEETHEADER structure.
Set the pfnCallBack member of the PROPSHEETHEADER structure to point to the callback function.
Implement the callback function. When this function receives the PSCB_PRECREATE message, it will also receive a pointer to the property sheet's dialog box template. Remove the DS_CONTEXTHELP style from this template.
The following sample illustrates how to implement such a callback function:int CALLBACK RemoveContextHelpProc(HWND hwnd, UINT message, LPARAM lParam)
{
switch (message) {
case PSCB_PRECREATE:
// Remove the DS_CONTEXTHELP style from the dialog box template
if (((LPDLGTEMPLATEEX)lParam)->signature == 0xFFFF){
((LPDLGTEMPLATEEX)lParam)->style &= ~DS_CONTEXTHELP;
}
else {
((LPDLGTEMPLATE)lParam)->style &= ~DS_CONTEXTHELP;
}
return TRUE;
}
return TRUE;
}If the DLGTEMPLATEEX structure is not defined, include the following declaration:#include <pshpack1.h>
typedef struct DLGTEMPLATEEX
{
WORD dlgVer;
WORD signature;
DWORD helpID;
DWORD exStyle;
DWORD style;
WORD cDlgItems;
short x;
short y;
short cx;
short cy;
} DLGTEMPLATEEX, *LPDLGTEMPLATEEX;
#include <poppack.h>
// its propertypage list, we have to remove all pages starting
// at index 1 (original location for the second page). Then,
// add them back one at a time.
for (int i = 1; i < count; i++)
sheet->RemovePage(i);
for (i = 1; i < arr_size; i++)
sheet->AddPage(m_PropPageArray[i]);
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: Add your specialized code here
CWnd* pWnd = GetDlgItem(IDHELP);
ASSERT(pWnd);
if(pWnd)pWnd->ShowWindow(FALSE); return bResult;
}