Changing the default printer settings for the entire system 
Author Message
 Changing the default printer settings for the entire system

Hi,
Does anybody know how I can change the default printer settings for the
entire system from my application?
With the MFC standard frame work message handler
(CWinApp::OnFilePrintSetup) this is only in effect for my application.

Thanks Hans



Sat, 27 Nov 2004 17:23:56 GMT  
 Changing the default printer settings for the entire system
Depends on your operating system.  If you are using 2000 or XP call
SetDefaultPrinter.  If you are using anything below those two you have to do
it in the WIN.INI.  Here is the code.

    WriteProfileString(TEXT("Windows"),TEXT("Device"),pszPrinterName ));
#if WM_WININICHANGE != WM_SETTINGCHANGE
    // Old message type; for windows 95
    SendNotifyMessage(HWND_BROADCAST,WM_WININICHANGE,0,(LPARAM)szWindows);
#endif
    // New message type
    SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,(LPARAM)szWindows);
Ali


Quote:
> Hi,
> Does anybody know how I can change the default printer settings for the
> entire system from my application?
> With the MFC standard frame work message handler
> (CWinApp::OnFilePrintSetup) this is only in effect for my application.

> Thanks Hans



Sat, 27 Nov 2004 17:54:22 GMT  
 Changing the default printer settings for the entire system
Thanks Ali,
I use Windows98SE
Unfortunately, your recommendation changes only the default printer, not the
default settings (paper, quality ...)
My task is to change the settings of the default printer permanently from my
application.
Any other ideas ?

Ali schrieb:

Quote:
> Depends on your operating system.  If you are using 2000 or XP call
> SetDefaultPrinter.  If you are using anything below those two you have to do
> it in the WIN.INI.  Here is the code.

>     WriteProfileString(TEXT("Windows"),TEXT("Device"),pszPrinterName ));
> #if WM_WININICHANGE != WM_SETTINGCHANGE
>     // Old message type; for windows 95
>     SendNotifyMessage(HWND_BROADCAST,WM_WININICHANGE,0,(LPARAM)szWindows);
> #endif
>     // New message type
>     SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,(LPARAM)szWindows);
> Ali



> > Hi,
> > Does anybody know how I can change the default printer settings for the
> > entire system from my application?
> > With the MFC standard frame work message handler
> > (CWinApp::OnFilePrintSetup) this is only in effect for my application.

> > Thanks Hans



Sun, 28 Nov 2004 09:09:49 GMT  
 Changing the default printer settings for the entire system
Oh I see, I thougth all you wanted to do was change the default printer.

Have you tried PrinterProperties function?  Or if you want more control try
SetPrinter, read the SetPrinter doc for global changes.

Ali


Quote:
> Thanks Ali,
> I use Windows98SE
> Unfortunately, your recommendation changes only the default printer, not
the
> default settings (paper, quality ...)
> My task is to change the settings of the default printer permanently from
my
> application.
> Any other ideas ?

> Ali schrieb:

> > Depends on your operating system.  If you are using 2000 or XP call
> > SetDefaultPrinter.  If you are using anything below those two you have
to do
> > it in the WIN.INI.  Here is the code.

> >     WriteProfileString(TEXT("Windows"),TEXT("Device"),pszPrinterName ));
> > #if WM_WININICHANGE != WM_SETTINGCHANGE
> >     // Old message type; for windows 95

SendNotifyMessage(HWND_BROADCAST,WM_WININICHANGE,0,(LPARAM)szWindows);
Quote:
> > #endif
> >     // New message type

SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,(LPARAM)szWindows);

- Show quoted text -

Quote:
> > Ali



> > > Hi,
> > > Does anybody know how I can change the default printer settings for
the
> > > entire system from my application?
> > > With the MFC standard frame work message handler
> > > (CWinApp::OnFilePrintSetup) this is only in effect for my application.

> > > Thanks Hans



Sun, 28 Nov 2004 17:54:59 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. System's Default Printer Settings on NT

2. change system default printer?

3. Change the default system printer with Visual C++

4. Windows Default Printers and Default Printer Setups

5. Problems Setting the Default printer with Win32 API SDK

6. Setting the Default Printer

7. Setting default printer via DEVMODE struct and EnumPrinters

8. Setting default printer in Win NT, and 2000

9. Setting the default windows printer

10. Setting the default printer

11. Setting the Default Printer

12. Setting New Default Printer for Application

 

 
Powered by phpBB® Forum Software