Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Win32:为什么我的PRINTDLG(或PRINTDLGEX)有灰色背景?_C++_User Interface_Winapi - Fatal编程技术网

C++ Win32:为什么我的PRINTDLG(或PRINTDLGEX)有灰色背景?

C++ Win32:为什么我的PRINTDLG(或PRINTDLGEX)有灰色背景?,c++,user-interface,winapi,C++,User Interface,Winapi,我正在使用Microsoft Visual Studio Community 2015 RC创建一个Win32应用程序。我用的是C++。 当我调用PrintDlg()或PrintDlgEx()时,生成的对话框具有灰色背景。无论如何,我检查过的所有其他程序中的同一个对话框都有白色背景 我看到有一些方法可以处理WM_CTLCOLORDLG来设置对话框的背景色,但是由于所有其他应用程序都有相同的行为,我不认为它们都是以相同的方式处理此消息的 我在这里包含了我用来打开对话框的代码PrintDlg():

我正在使用Microsoft Visual Studio Community 2015 RC创建一个Win32应用程序。我用的是C++。 当我调用
PrintDlg()
PrintDlgEx()
时,生成的对话框具有灰色背景。无论如何,我检查过的所有其他程序中的同一个对话框都有白色背景

我看到有一些方法可以处理
WM_CTLCOLORDLG
来设置对话框的背景色,但是由于所有其他应用程序都有相同的行为,我不认为它们都是以相同的方式处理此消息的

我在这里包含了我用来打开对话框的代码
PrintDlg()

以及
PrintDlgEx()
的代码:

我的申请有什么问题


非常感谢。

您的流程可能没有主题化,因为它没有表现出来。非主题对话框默认为按钮面彩色背景。主题对话框有白色背景


将comctl32 v6清单添加到可执行文件中

改用PrintDlgEx()。@HansPassant我已经尝试过使用
PrintDlgEx()
,但得到了相同的结果。请显示您正在使用的代码。@IInspectable我已经使用PrintDlgEx包含了代码。是的,这解决了我的问题。非常感谢你的帮助!
PRINTDLG print_dialog{
    sizeof(PRINTDLG),
    hWnd,
    NULL, NULL, NULL,
    0,
    0, 0, 0, 0,
    1,
    NULL, 0,
    NULL,
};
if (PrintDlg(&print_dialog))
{
    ...
}
PRINTDLGEX print_dialog = {};
print_dialog.lStructSize = sizeof(PRINTDLGEX);
print_dialog.hwndOwner = hWnd;
print_dialog.Flags = PD_NOPAGENUMS;
print_dialog.nStartPage = START_PAGE_GENERAL;
if (PrintDlgEx(&print_dialog))
{
    ...
}