我使用Microsoft Visual Studio Community 2015 RC创建了一个Win32应用程序。我正在使用C++。Win32:为什么我的PRINTDLG(或PRINTDLGEX)有灰色背景?
当我呼叫PrintDlg()
或PrintDlgEx()
时,生成的对话框具有灰色背景。无论如何,我检查过的所有其他程序中的同一个对话框具有白色背景。
我看到有处理WM_CTLCOLORDLG
设置对话框的背景颜色的方法,但由于所有其他应用程序具有相同的行为,我不认为它们都是以相同的方式处理此消息。
我这里有我用用PrintDlg()
打开对话框代码:
PRINTDLG print_dialog{
sizeof(PRINTDLG),
hWnd,
NULL, NULL, NULL,
0,
0, 0, 0, 0,
1,
NULL, 0,
NULL,
};
if (PrintDlg(&print_dialog))
{
...
}
和代码为PrintDlgEx()
:
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))
{
...
}
什么是错误的,我的应用程序?
非常感谢。
改为使用PrintDlgEx()。 –
@HansPassant我已经尝试过使用'PrintDlgEx()',但我获得了相同的结果。 – brouwer89
请在[PrintDlgEx](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646942.aspx)上显示代码。 – IInspectable