Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using C++ and plain Winapi calls to display Print dialog box and it works fine. However the dialog box I get shows old printer icons compared to similar Print dialogs produced by other software. I wonder why.

Does anyone have an idea how to display the new printer icons as does MS Paint dialog or similar software.

Thanks a lot.

Note: I tried to put screen shots of the dialog boxes but could not find how. Without the screen shots the question might be difficult to describe/understand. sorry...

What I have tried:

Here is how I display the Print Dialog in my application:
C++
// Initialize the PRINTDLGEX structure
PRINTDLGEX  PrnDlgEx ;

PrnDlgEx.lStructSize = sizeof (PRINTDLGEX) ;
PrnDlgEx.hwndOwner = hwnd ;
PrnDlgEx.hDevMode  = NULL ;
PrnDlgEx.hDevNames = NULL ;
PrnDlgEx.hDC = NULL ;
PrnDlgEx.Flags = PD_HIDEPRINTTOFILE | PD_NOCURRENTPAGE | PD_NOPAGENUMS |
                 PD_NOSELECTION | PD_USEDEVMODECOPIESANDCOLLATE ;
PrnDlgEx.Flags2 = 0 ;
PrnDlgEx.ExclusionFlags = 0 ;
PrnDlgEx.nPageRanges = 0 ;
PrnDlgEx.nMaxPageRanges = 0 ;
PrnDlgEx.lpPageRanges = nullptr ;
PrnDlgEx.nMinPage = 1 ;
PrnDlgEx.nMaxPage = 0xFFFF ;
PrnDlgEx.nCopies  = 1 ;
PrnDlgEx.hInstance = NULL ;
PrnDlgEx.lpPrintTemplateName = NULL ;
PrnDlgEx.lpCallback = NULL ;
PrnDlgEx.nPropertyPages = 0 ;
PrnDlgEx.lphPropertyPages = NULL ;
PrnDlgEx.nStartPage = START_PAGE_GENERAL ;
PrnDlgEx.dwResultAction = 0 ;

HRESULT Result = PrintDlgEx (&PrnDlgEx) ;
Posted
Updated 11-Jul-20 7:04am

1 solution

You need to tell the system to enable the modern visual style usage, see Enabling Visual Styles - Win32 apps | Microsoft Docs[^].
 
Share this answer
 
Comments
Member 14726454 11-Jul-20 15:32pm    
I do enable visual style as per MS Docs by the following code:

#pragma comment(lib,"comctl32.lib")
#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

The displayed icons in Print dialog are not affected by visual style...
Richard MacCutchan 12-Jul-20 4:26am    
Sorry, but that is the only way I have changed any visuals. But I don't have any real idea what icons your complaint is about. Without some images it is difficult to guess what you are seeing.
Member 14726454 13-Jul-20 7:08am    
Please check the below link. I have posted the same question there with screen shots for my Print dialog and MS Paint Print dialog.
The printer icons in the printer list look different.
https://stackoverflow.com/questions/62849202/printer-icons-in-print-dialog-box
Richard MacCutchan 13-Jul-20 7:54am    
They all look fine to me. What is the problem?
Member 14726454 13-Jul-20 8:45am    
The printer icons shown in MS packages looks different. The one I get in my Print dialog seems old. I found same icons in MS Notepad, MS VC and MS Paint...etc. I wonder if there is a new version of common control Print dialog similar to the new Open and Save As dialog that you get with FileDialog.CoCreateInstance ().

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900