Re: =?utf-8?B?SXNuJ3Qg4oCcIE1pY3JvU29mdCBXb3JkIC0tPiBGaWxlIC0tPiBQYWdlIFM=?=
=?utf-8?B?ZXR1cCDigJ0gc3BlY2lhbCB0byBXb3JkID8=?=
Mr. Relf,
I thank you for your your attempt to help, and I may be completely not getting your explanations, but I believe you are completely missing my problem.
It doesn't make sense to try to call PrintDlg from inside PrintDlg.
Also, what is the point in setting DMORIENT_LANDSCAPE if, as I have said previously, it is not working on some printers/plotters and, I need to set "Rotated Landscape" instead?
And, if Microsoft is not doing something special that is beyond what they document, then only the layout of ??? MicroSoft Word --> File --> Page Setup ??? is special to Word. They should be simply hooking into PageSetupDlg via PSD_ENABLEPAGESETUPTEMPLATE and PSD_ENABLEPAGESETUPHOOK then, just creating their own template. But, I am not sure how switching from PrintDlg to PageSetupDlg is going to help me?
And on a side note that is just FYI, in my personal experience, many printer/plotters do not work with ResetDC. You are much better off leaving out PD_RETURNDC and using CreateDC in place of ResetDC. For example if you wanted to change the number of copies, I think you would find that many printers and plotters would ignore your setting unless you use CreateDC.
PRINTDLG PrnRec = { sizeof PrnRec };
PrnRec.Flags = PD_RETURNDEFAULT;
PrintDlg ( & PrnRec );
DEVMODE * pPrinter = ( DEVMODE * ) GlobalLock( PrnRec.hDevMode );
DEVNAMES * pDevNames = ( DEVNAMES * ) GlobalLock( PrnRec.hDevNames );
char * pDevice = ( LPTSTR )pDevNames + pDevNames->wDeviceOffset;
pPrinter->dmFields = DM_COPIES | DM_ORIENTATION;
pPrinter->dmCopies = nCopies;
pPrinter->dmOrientation = DMORIENT_LANDSCAPE ;
HDC DC_Printer = CreateDC("WINSPOOL", pDevice, NULL, pPrinter);
GlobalUnlock( PrnRec.hDevNames );
GlobalUnlock( PrnRec.hDevMode );
On Tue, 02 Oct 2007 17:07:15 -0500, Jeff???Relf <Jeff_Relf@Yahoo.COM> wrote:
Isn't ??? MicroSoft Word --> File --> Page Setup ??? special to Word ?
I think you'll have to do something like that, Mr. Murdock.
You can query PrintDlg() ( sans the user-interface ) like this:
??? PRINTDLG PrnRec = { sizeof PrnRec };
PrnRec.Flags = PD_RETURNDEFAULT | PD_RETURNDC ;
PrintDlg ( & PrnRec );
HDC DC_Printer = PrnRec.hDC ; ???.
and set the page-orientation like this:
??? DEVMODE * Printer = ( DEVMODE * ) GlobalLock( PrnRec.hDevMode );
// or DMORIENT_PORTRAIT ;
Printer->dmOrientation = DMORIENT_LANDSCAPE ;
ResetDC( DC_Printer, Printer ); GlobalUnlock( PrnRec.hDevMode ); ???.