在哪拦截啊?对话框过程?每个页都有一个对话框过程.... 急啊,我甚至在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 ?
急啊,我甚至在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 ?