Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / MS / Internal / Printing / NativeMethods.cs / 1 / NativeMethods.cs
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using MS.Internal.PresentationFramework;
namespace MS.Internal.Printing
{
internal static class NativeMethods
{
internal const UInt32 PD_ALLPAGES = 0x00000000;
internal const UInt32 PD_PAGENUMS = 0x00000002;
internal const UInt32 PD_NOSELECTION = 0x00000004;
internal const UInt32 PD_NOPAGENUMS = 0x00000008;
internal const UInt32 PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000;
internal const UInt32 PD_DISABLEPRINTTOFILE = 0x00080000;
internal const UInt32 PD_HIDEPRINTTOFILE = 0x00100000;
internal const UInt32 PD_NOCURRENTPAGE = 0x00800000;
internal const UInt32 PD_RESULT_CANCEL = 0x0;
internal const UInt32 PD_RESULT_PRINT = 0x1;
internal const UInt32 PD_RESULT_APPLY = 0x2;
internal const UInt32 START_PAGE_GENERAL = 0xFFFFFFFF;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal class PRINTDLGEX32
{
public int lStructSize = SecurityHelper.SizeOf(typeof(PRINTDLGEX32));
public IntPtr hwndOwner = IntPtr.Zero;
public IntPtr hDevMode = IntPtr.Zero;
public IntPtr hDevNames = IntPtr.Zero;
public IntPtr hDC = IntPtr.Zero;
public UInt32 Flags = 0;
public UInt32 Flags2 = 0;
public UInt32 ExclusionFlags = 0;
public UInt32 nPageRanges = 0;
public UInt32 nMaxPageRanges = 0;
public IntPtr lpPageRanges = IntPtr.Zero;
public UInt32 nMinPage = 0;
public UInt32 nMaxPage = 0;
public UInt32 nCopies = 0;
public IntPtr hInstance = IntPtr.Zero;
public IntPtr lpPrintTemplateName = IntPtr.Zero;
public IntPtr lpCallback = IntPtr.Zero;
public UInt32 nPropertyPages = 0;
public IntPtr lphPropertyPages = IntPtr.Zero;
public UInt32 nStartPage = START_PAGE_GENERAL;
public UInt32 dwResultAction = 0;
}
[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)]
internal class PRINTDLGEX64
{
public int lStructSize = SecurityHelper.SizeOf(typeof(PRINTDLGEX64));
public IntPtr hwndOwner = IntPtr.Zero;
public IntPtr hDevMode = IntPtr.Zero;
public IntPtr hDevNames = IntPtr.Zero;
public IntPtr hDC = IntPtr.Zero;
public UInt32 Flags = 0;
public UInt32 Flags2 = 0;
public UInt32 ExclusionFlags = 0;
public UInt32 nPageRanges = 0;
public UInt32 nMaxPageRanges = 0;
public IntPtr lpPageRanges = IntPtr.Zero;
public UInt32 nMinPage = 0;
public UInt32 nMaxPage = 0;
public UInt32 nCopies = 0;
public IntPtr hInstance = IntPtr.Zero;
public IntPtr lpPrintTemplateName = IntPtr.Zero;
public IntPtr lpCallback = IntPtr.Zero;
public UInt32 nPropertyPages = 0;
public IntPtr lphPropertyPages = IntPtr.Zero;
public UInt32 nStartPage = START_PAGE_GENERAL;
public UInt32 dwResultAction = 0;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal struct DEVMODE
{
private const int CCHDEVICENAME = 32;
private const int CCHFORMNAME = 32;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHDEVICENAME)]
public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
public short dmSize;
public short dmDriverExtra;
public int dmFields;
public int dmPositionX;
public int dmPositionY;
public int dmDisplayOrientation;
public int dmDisplayFixedOutput;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHFORMNAME)]
public string dmFormName;
public short dmLogPixels;
public int dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmICMMethod;
public int dmICMIntent;
public int dmMediaType;
public int dmDitherType;
public int dmReserved1;
public int dmReserved2;
public int dmPanningWidth;
public int dmPanningHeight;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal struct DEVNAMES
{
public ushort wDriverOffset;
public ushort wDeviceOffset;
public ushort wOutputOffset;
public ushort wDefault;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal struct PRINTPAGERANGE
{
public UInt32 nFromPage;
public UInt32 nToPage;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using MS.Internal.PresentationFramework;
namespace MS.Internal.Printing
{
internal static class NativeMethods
{
internal const UInt32 PD_ALLPAGES = 0x00000000;
internal const UInt32 PD_PAGENUMS = 0x00000002;
internal const UInt32 PD_NOSELECTION = 0x00000004;
internal const UInt32 PD_NOPAGENUMS = 0x00000008;
internal const UInt32 PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000;
internal const UInt32 PD_DISABLEPRINTTOFILE = 0x00080000;
internal const UInt32 PD_HIDEPRINTTOFILE = 0x00100000;
internal const UInt32 PD_NOCURRENTPAGE = 0x00800000;
internal const UInt32 PD_RESULT_CANCEL = 0x0;
internal const UInt32 PD_RESULT_PRINT = 0x1;
internal const UInt32 PD_RESULT_APPLY = 0x2;
internal const UInt32 START_PAGE_GENERAL = 0xFFFFFFFF;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal class PRINTDLGEX32
{
public int lStructSize = SecurityHelper.SizeOf(typeof(PRINTDLGEX32));
public IntPtr hwndOwner = IntPtr.Zero;
public IntPtr hDevMode = IntPtr.Zero;
public IntPtr hDevNames = IntPtr.Zero;
public IntPtr hDC = IntPtr.Zero;
public UInt32 Flags = 0;
public UInt32 Flags2 = 0;
public UInt32 ExclusionFlags = 0;
public UInt32 nPageRanges = 0;
public UInt32 nMaxPageRanges = 0;
public IntPtr lpPageRanges = IntPtr.Zero;
public UInt32 nMinPage = 0;
public UInt32 nMaxPage = 0;
public UInt32 nCopies = 0;
public IntPtr hInstance = IntPtr.Zero;
public IntPtr lpPrintTemplateName = IntPtr.Zero;
public IntPtr lpCallback = IntPtr.Zero;
public UInt32 nPropertyPages = 0;
public IntPtr lphPropertyPages = IntPtr.Zero;
public UInt32 nStartPage = START_PAGE_GENERAL;
public UInt32 dwResultAction = 0;
}
[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)]
internal class PRINTDLGEX64
{
public int lStructSize = SecurityHelper.SizeOf(typeof(PRINTDLGEX64));
public IntPtr hwndOwner = IntPtr.Zero;
public IntPtr hDevMode = IntPtr.Zero;
public IntPtr hDevNames = IntPtr.Zero;
public IntPtr hDC = IntPtr.Zero;
public UInt32 Flags = 0;
public UInt32 Flags2 = 0;
public UInt32 ExclusionFlags = 0;
public UInt32 nPageRanges = 0;
public UInt32 nMaxPageRanges = 0;
public IntPtr lpPageRanges = IntPtr.Zero;
public UInt32 nMinPage = 0;
public UInt32 nMaxPage = 0;
public UInt32 nCopies = 0;
public IntPtr hInstance = IntPtr.Zero;
public IntPtr lpPrintTemplateName = IntPtr.Zero;
public IntPtr lpCallback = IntPtr.Zero;
public UInt32 nPropertyPages = 0;
public IntPtr lphPropertyPages = IntPtr.Zero;
public UInt32 nStartPage = START_PAGE_GENERAL;
public UInt32 dwResultAction = 0;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal struct DEVMODE
{
private const int CCHDEVICENAME = 32;
private const int CCHFORMNAME = 32;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHDEVICENAME)]
public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
public short dmSize;
public short dmDriverExtra;
public int dmFields;
public int dmPositionX;
public int dmPositionY;
public int dmDisplayOrientation;
public int dmDisplayFixedOutput;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHFORMNAME)]
public string dmFormName;
public short dmLogPixels;
public int dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmICMMethod;
public int dmICMIntent;
public int dmMediaType;
public int dmDitherType;
public int dmReserved1;
public int dmReserved2;
public int dmPanningWidth;
public int dmPanningHeight;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal struct DEVNAMES
{
public ushort wDriverOffset;
public ushort wDeviceOffset;
public ushort wOutputOffset;
public ushort wDefault;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)]
internal struct PRINTPAGERANGE
{
public UInt32 nFromPage;
public UInt32 nToPage;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HMACRIPEMD160.cs
- DbSourceParameterCollection.cs
- PrimitiveSchema.cs
- MergePropertyDescriptor.cs
- LabelLiteral.cs
- _DisconnectOverlappedAsyncResult.cs
- CfgArc.cs
- UnionQueryOperator.cs
- XPathSelectionIterator.cs
- AssertFilter.cs
- RelationalExpressions.cs
- Enum.cs
- Completion.cs
- FutureFactory.cs
- ErrorLog.cs
- TableRow.cs
- FixedBufferAttribute.cs
- XmlSerializationReader.cs
- VirtualPath.cs
- RequiredArgumentAttribute.cs
- DetailsViewRowCollection.cs
- TrackingQueryElement.cs
- ToolStripDropDownButton.cs
- UserUseLicenseDictionaryLoader.cs
- ElementUtil.cs
- DataBindingCollection.cs
- controlskin.cs
- _CookieModule.cs
- Path.cs
- RequestCachePolicyConverter.cs
- SqlRowUpdatedEvent.cs
- NavigationService.cs
- RepeatButtonAutomationPeer.cs
- MethodBody.cs
- UnsafeNativeMethods.cs
- ManagementPath.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- C14NUtil.cs
- DiscoveryRequestHandler.cs
- ClientTargetSection.cs
- ErrorHandler.cs
- XmlDomTextWriter.cs
- XmlRawWriterWrapper.cs
- DesignerDataParameter.cs
- ListenerElementsCollection.cs
- TranslateTransform.cs
- PathData.cs
- CodeLinePragma.cs
- EnumDataContract.cs
- SemanticResolver.cs
- ApplicationTrust.cs
- SafeTimerHandle.cs
- EntityConnectionStringBuilder.cs
- WebZone.cs
- OdbcError.cs
- BlurEffect.cs
- EntityDataSourceContextCreatedEventArgs.cs
- DesignerHelpers.cs
- AppDomainShutdownMonitor.cs
- GridView.cs
- QuestionEventArgs.cs
- WindowInteractionStateTracker.cs
- AssemblyHash.cs
- Int32CollectionValueSerializer.cs
- loginstatus.cs
- TableProvider.cs
- Trace.cs
- RawStylusInputCustomDataList.cs
- ProcessProtocolHandler.cs
- NetworkInterface.cs
- UnmanagedMemoryStream.cs
- CheckBoxList.cs
- ProcessProtocolHandler.cs
- PropertiesTab.cs
- Rect3D.cs
- IteratorFilter.cs
- ListenerElementsCollection.cs
- _ScatterGatherBuffers.cs
- IdentityReference.cs
- AccessViolationException.cs
- SemanticAnalyzer.cs
- InertiaTranslationBehavior.cs
- MethodCallConverter.cs
- DataGridViewCellFormattingEventArgs.cs
- ApplicationServiceManager.cs
- LambdaCompiler.Binary.cs
- DataServiceStreamResponse.cs
- Compiler.cs
- FunctionQuery.cs
- AssemblyAttributesGoHere.cs
- CustomAttributeBuilder.cs
- StrokeCollection.cs
- DescendentsWalkerBase.cs
- SymmetricKeyWrap.cs
- StylusLogic.cs
- DBConcurrencyException.cs
- FrameworkElementFactoryMarkupObject.cs
- SequenceDesigner.cs
- LocalizableAttribute.cs
- EntityCommandExecutionException.cs