用API建了个简单的属性对话框,可不论点"确定"还是"取消"按钮或是右上方的"X",都无法关闭它。我想通过在pfnDlgProc中处理PSN_KILLACTIVE来关闭它,可页面切换时也会产生此消息.....
怎么办啊?
怎么办啊?
解决方案 »
- 局域网中机器打开网页整个发包流程?
- windows mobile 开发的前景怎么样啊?
- release下需要添加bmp文件吗~~~~~~~~~~~~~~
- 求二维条码(pdf417)的相关资料或源代码(windows平台)?
- 有无API得到计算机上的所有用户?并查看他们的密码是否足够复杂???
- 提问:各位请帮忙,晚上结贴!!
- ★★★www.csdn.com.cn★★★已经开通~目前正在测试阶段~!!
- 寻找操作系统的书 用MFC讲解
- 如何建立一个变量,使它能给任一个类(对话框类)读取,并能在一个对话框类里可以进行修改
- 本人新学菜鸟一枚,求读文件件
- 我想在开始按钮旁边再增加一个按钮,然后弹出自己设计的开始菜单,请问有没有办法?
- 找不到 DES.h
急啊,我甚至在codeguru上发了篇贴子,可能E文不好吧,人家看不懂,无人回复...
create a Property Sheet ,with PSH_MODELESS |PSH_NOAPPLYNOW style. It has two pages .
Note pfnDlgProc :BOOL CALLBACK PageProc_0 (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) // PageProc_1 is similar
{
switch (uMsg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
//...
return TRUE;
case WM_NOTIFY:switch (((NMHDR FAR *) lParam)->code)
{
case PSN_SETACTIVE:
{
return TRUE ;
}case PSN_KILLACTIVE:
{
SetWindowLongPtr(hwnd,DWLP_MSGRESULT,FALSE);
return TRUE ;
}case PSN_APPLY:
{
SetWindowLongPtr(hwnd,DWLP_MSGRESULT,PSNRET_NOERROR);
return TRUE ;
}case PSN_RESET:
{
return TRUE ;
}}//end switchbreak;
}//end switch(uMsg) return (FALSE);
}//end functionI clicks the OK or Cancel button ,or the "X" button, but the Property Sheet can't be closed ! The MSDN said "The OK and Apply buttons are similar ...The only difference is that clicking the OK button causes the property sheet to be destroyed after the changes are applied. "I have validate the changes by processing PSN_KILLACTIVE ( call the SetWindowLong function with the DWL_MSGRESULT value set to FALSE)
and I call SetWindowLong with DWL_MSGRESULT set to PSNRET_NOERROR to indicate to the property sheet that the changes are valid for the page.Now ,why the Property Sheet not be closed ? How do I turn it off by clicks the OK or Cancel button ,or by clicks the "X" button ?