예제 #1
0
 // Create a PRINTDLG with a few useful defaults.
 internal static NativeMethods.PRINTDLG CreatePRINTDLG()
 {
     NativeMethods.PRINTDLG data = null;
     if (IntPtr.Size == 4)
     {
         data = new NativeMethods.PRINTDLG_32();
     }
     else
     {
         data = new NativeMethods.PRINTDLG_64();
     }
     data.lStructSize         = Marshal.SizeOf(data);
     data.hwndOwner           = IntPtr.Zero;
     data.hDevMode            = IntPtr.Zero;
     data.hDevNames           = IntPtr.Zero;
     data.Flags               = 0;
     data.hDC                 = IntPtr.Zero;
     data.nFromPage           = 1;
     data.nToPage             = 1;
     data.nMinPage            = 0;
     data.nMaxPage            = 9999;
     data.nCopies             = 1;
     data.hInstance           = IntPtr.Zero;
     data.lCustData           = IntPtr.Zero;
     data.lpfnPrintHook       = null;
     data.lpfnSetupHook       = null;
     data.lpPrintTemplateName = null;
     data.lpSetupTemplateName = null;
     data.hPrintTemplate      = IntPtr.Zero;
     data.hSetupTemplate      = IntPtr.Zero;
     return(data);
 }
예제 #2
0
 // Create a PRINTDLG with a few useful defaults.
 internal static NativeMethods.PRINTDLG CreatePRINTDLG() {
     NativeMethods.PRINTDLG data = null;
     if (IntPtr.Size == 4) {
         data = new NativeMethods.PRINTDLG_32();
     }
     else {
         data = new NativeMethods.PRINTDLG_64();
     }
     data.lStructSize = Marshal.SizeOf(data);
     data.hwndOwner = IntPtr.Zero;
     data.hDevMode = IntPtr.Zero;
     data.hDevNames = IntPtr.Zero;
     data.Flags = 0;
     data.hDC = IntPtr.Zero;
     data.nFromPage = 1;
     data.nToPage = 1;
     data.nMinPage = 0;
     data.nMaxPage = 9999;
     data.nCopies = 1;
     data.hInstance = IntPtr.Zero;
     data.lCustData = IntPtr.Zero;
     data.lpfnPrintHook = null;
     data.lpfnSetupHook = null;
     data.lpPrintTemplateName = null;
     data.lpSetupTemplateName = null;
     data.hPrintTemplate = IntPtr.Zero;
     data.hSetupTemplate = IntPtr.Zero;
     return data;
 }
예제 #3
0
 public static extern bool PrintDlg_32([In, Out] NativeMethods.PRINTDLG_32 lppd);