CALLBACK PropPageDlgProc永远不会在Windows 10中执行“case WM_INITDIALOG:” [英] CALLBACK PropPageDlgProc never executes “case WM_INITDIALOG:” in windows 10

查看:93
本文介绍了CALLBACK PropPageDlgProc永远不会在Windows 10中执行“case WM_INITDIALOG:”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 IShellPropSheetExt :: AddPages()方法添加一个属性页面。当我单击文件夹的属性时,会显示新添加的选项卡。但是,当我单击该选项卡时,不会显示新添加的属性页,并且该选项卡将消失。
这只发生在win10中。在正常情况下,当我单击新添加的页面选项卡时,重复调用PropPageDlgProc,在14次调用后,uMsg值与WM_INITDIALOG匹配,然后调用OnInitDialog()。在OnInitDialog中,我正在生成新的属性页面。
这样就会显示新的属性页面。但是在win10的情况下,PropPageDlgProc只被调用5次,而uMsg值永远不会与WM_INITDIALOG匹配。因此,不会调用OnInitDialog(),也不会显示新添加的属性页。这是因为
的任何编译问题?我使用的是Visual Studio 2013.我在此处发布了代码
" https://stackoverflow.com/questions/46480889/fileproppagedlgproc-never-executes-case-wm- initdialog-in-windows-10"



$



I am using IShellPropSheetExt::AddPages() method to add one more property page. When I click on properties of folder, newly added tab is displayed. But when I click on that tab, newly added property page is not displayed and that tab disappears. This happens only in win10. In normal cases, when I click on newly added page tab, PropPageDlgProc is called repeatedly, after 14 calls uMsg value matches with WM_INITDIALOG and then OnInitDialog() is called. In OnInitDialog I am generating new property page. In this way new property page is displayed. But in case of win10, PropPageDlgProc is called only 5 times and uMsg value never matches with WM_INITDIALOG. So  OnInitDialog() is not called and newly added property page is not displayed. Is this because of any compiler issue? I am using Visual Studio 2013. I have posted code here "https://stackoverflow.com/questions/46480889/fileproppagedlgproc-never-executes-case-wm-initdialog-in-windows-10"




推荐答案

您好,

属性页的AFAIK OnInitDialog未在AddPage函数中调用。当使用PropSheet.SetActivePage(thePage)激活属性页面或单击页面时调用它。

AFAIK OnInitDialog of the property pages is not called in AddPage function. It is called when the property page gets active with PropSheet.SetActivePage(thePage) or when you click through the pages.

如果要调用所有属性页的OnInitDialog,则必须每个都调用SetActive以编程方式创建您的字符表后页面。

If you want to call OnInitDialog of all property pages, you must SetActive each page programmatically after you create your poperty sheet.

// add pages
m_Sheet.AddPage(&m_pg1);
m_Sheet.AddPage(&m_pg2);
m_Sheet.AddPage(&m_pg3);
m_Sheet.AddPage(&m_pg4);
// set active all pages to activate InitDialog of the pages
m_Sheet.SetSctivePage(0);
m_Sheet.SetSctivePage(1);
m_Sheet.SetSctivePage(2);
m_Sheet.SetSctivePage(3);
// set the first page visible first
m_Sheet.SetSctivePage(0);

问候,Guido


这篇关于CALLBACK PropPageDlgProc永远不会在Windows 10中执行“case WM_INITDIALOG:”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆