コード例 #1
0
 internal static System.Windows.Forms.NativeMethods.PRINTDLG CreatePRINTDLG()
 {
     System.Windows.Forms.NativeMethods.PRINTDLG structure = null;
     if (IntPtr.Size == 4)
     {
         structure = new System.Windows.Forms.NativeMethods.PRINTDLG_32();
     }
     else
     {
         structure = new System.Windows.Forms.NativeMethods.PRINTDLG_64();
     }
     structure.lStructSize = Marshal.SizeOf(structure);
     structure.hwndOwner = IntPtr.Zero;
     structure.hDevMode = IntPtr.Zero;
     structure.hDevNames = IntPtr.Zero;
     structure.Flags = 0;
     structure.hDC = IntPtr.Zero;
     structure.nFromPage = 1;
     structure.nToPage = 1;
     structure.nMinPage = 0;
     structure.nMaxPage = 0x270f;
     structure.nCopies = 1;
     structure.hInstance = IntPtr.Zero;
     structure.lCustData = IntPtr.Zero;
     structure.lpfnPrintHook = null;
     structure.lpfnSetupHook = null;
     structure.lpPrintTemplateName = null;
     structure.lpSetupTemplateName = null;
     structure.hPrintTemplate = IntPtr.Zero;
     structure.hSetupTemplate = IntPtr.Zero;
     return structure;
 }
コード例 #2
0
 internal static System.Windows.Forms.NativeMethods.PRINTDLG CreatePRINTDLG()
 {
     System.Windows.Forms.NativeMethods.PRINTDLG structure = null;
     if (IntPtr.Size == 4)
     {
         structure = new System.Windows.Forms.NativeMethods.PRINTDLG_32();
     }
     else
     {
         structure = new System.Windows.Forms.NativeMethods.PRINTDLG_64();
     }
     structure.lStructSize         = Marshal.SizeOf(structure);
     structure.hwndOwner           = IntPtr.Zero;
     structure.hDevMode            = IntPtr.Zero;
     structure.hDevNames           = IntPtr.Zero;
     structure.Flags               = 0;
     structure.hDC                 = IntPtr.Zero;
     structure.nFromPage           = 1;
     structure.nToPage             = 1;
     structure.nMinPage            = 0;
     structure.nMaxPage            = 0x270f;
     structure.nCopies             = 1;
     structure.hInstance           = IntPtr.Zero;
     structure.lCustData           = IntPtr.Zero;
     structure.lpfnPrintHook       = null;
     structure.lpfnSetupHook       = null;
     structure.lpPrintTemplateName = null;
     structure.lpSetupTemplateName = null;
     structure.hPrintTemplate      = IntPtr.Zero;
     structure.hSetupTemplate      = IntPtr.Zero;
     return(structure);
 }