Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / WinFormsIntegration / MS / Win32 / UnsafeNativeMethods.cs / 1 / UnsafeNativeMethods.cs
using System; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; namespace MS.Win32 { internal static class UnsafeNativeMethods { [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)] public static extern bool IsChild(IntPtr hWndParent, IntPtr hwnd); [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)] public static extern IntPtr GetFocus(); [DllImport("User32", ExactSpelling = true, CharSet = CharSet.Auto)] internal static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent); [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool TranslateMessage([In, Out] ref System.Windows.Interop.MSG msg); [DllImport(ExternDll.User32, CharSet = CharSet.Auto)] public static extern IntPtr DispatchMessage([In] ref System.Windows.Interop.MSG msg); [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)] internal static extern IntPtr SendMessage(HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam); [DllImport(ExternDll.Gdi32, ExactSpelling = true, CharSet = CharSet.Auto)] public static extern int GetDeviceCaps(DCSafeHandle hDC, int nIndex); [DllImport(ExternDll.Gdi32, EntryPoint = "CreateDC", CharSet = CharSet.Auto)] private static extern DCSafeHandle IntCreateDC(string lpszDriver, string lpszDeviceName, string lpszOutput, IntPtr devMode); public static DCSafeHandle CreateDC(string lpszDriver) { return IntCreateDC(lpszDriver, null, null, IntPtr.Zero); } [DllImport(ExternDll.Gdi32, ExactSpelling = true, CharSet = CharSet.Auto)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public static extern bool DeleteDC(IntPtr hDC); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; namespace MS.Win32 { internal static class UnsafeNativeMethods { [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)] public static extern bool IsChild(IntPtr hWndParent, IntPtr hwnd); [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)] public static extern IntPtr GetFocus(); [DllImport("User32", ExactSpelling = true, CharSet = CharSet.Auto)] internal static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent); [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool TranslateMessage([In, Out] ref System.Windows.Interop.MSG msg); [DllImport(ExternDll.User32, CharSet = CharSet.Auto)] public static extern IntPtr DispatchMessage([In] ref System.Windows.Interop.MSG msg); [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)] internal static extern IntPtr SendMessage(HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam); [DllImport(ExternDll.Gdi32, ExactSpelling = true, CharSet = CharSet.Auto)] public static extern int GetDeviceCaps(DCSafeHandle hDC, int nIndex); [DllImport(ExternDll.Gdi32, EntryPoint = "CreateDC", CharSet = CharSet.Auto)] private static extern DCSafeHandle IntCreateDC(string lpszDriver, string lpszDeviceName, string lpszOutput, IntPtr devMode); public static DCSafeHandle CreateDC(string lpszDriver) { return IntCreateDC(lpszDriver, null, null, IntPtr.Zero); } [DllImport(ExternDll.Gdi32, ExactSpelling = true, CharSet = CharSet.Auto)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public static extern bool DeleteDC(IntPtr hDC); } } // 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
- SqlTypeConverter.cs
- ProjectionPlanCompiler.cs
- AssemblyBuilder.cs
- basenumberconverter.cs
- PeerTransportSecurityElement.cs
- TransactionContextValidator.cs
- SoapSchemaExporter.cs
- ClientRequest.cs
- InputReportEventArgs.cs
- ResXBuildProvider.cs
- WasEndpointConfigContainer.cs
- sqlstateclientmanager.cs
- StylusEventArgs.cs
- DatePickerTextBox.cs
- XmlTypeAttribute.cs
- Request.cs
- AudienceUriMode.cs
- DocumentPageHost.cs
- DecoderFallbackWithFailureFlag.cs
- AuthenticationService.cs
- FormClosedEvent.cs
- FacetValues.cs
- Environment.cs
- QueryAccessibilityHelpEvent.cs
- NumberFunctions.cs
- BoolExpression.cs
- TraceContextRecord.cs
- MemberMaps.cs
- XmlAnyElementAttributes.cs
- AssemblyResourceLoader.cs
- ResourcePart.cs
- AnnotationComponentManager.cs
- ParserExtension.cs
- SwitchElementsCollection.cs
- sortedlist.cs
- NameValueSectionHandler.cs
- XmlSchemaException.cs
- RoutedEventArgs.cs
- FirstMatchCodeGroup.cs
- DbProviderConfigurationHandler.cs
- NetDataContractSerializer.cs
- HyperLinkColumn.cs
- WebPartEditVerb.cs
- DecimalStorage.cs
- PhysicalAddress.cs
- ActivitySurrogate.cs
- DataTablePropertyDescriptor.cs
- ListView.cs
- StsCommunicationException.cs
- Operand.cs
- BuildManager.cs
- StateRuntime.cs
- Vector3dCollection.cs
- PropertyGeneratedEventArgs.cs
- SqlWorkflowPersistenceService.cs
- LogExtent.cs
- ConfigXmlReader.cs
- EntityConnectionStringBuilderItem.cs
- FontSource.cs
- XamlSerializer.cs
- FileSystemEnumerable.cs
- OwnerDrawPropertyBag.cs
- Attributes.cs
- SqlCacheDependency.cs
- TextTrailingCharacterEllipsis.cs
- Section.cs
- StringBuilder.cs
- Margins.cs
- DataGridViewBindingCompleteEventArgs.cs
- COM2ExtendedBrowsingHandler.cs
- SHA512.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- SecurityContext.cs
- DataFormats.cs
- WebPartConnectionsDisconnectVerb.cs
- ArrayTypeMismatchException.cs
- Clipboard.cs
- PreviewPageInfo.cs
- RoutedPropertyChangedEventArgs.cs
- securitycriticaldata.cs
- QilSortKey.cs
- SqlDataSourceCommandEventArgs.cs
- SqlDelegatedTransaction.cs
- BooleanStorage.cs
- SymmetricKey.cs
- MouseEvent.cs
- SpeechSynthesizer.cs
- CallbackHandler.cs
- ElasticEase.cs
- FormatterServices.cs
- HwndPanningFeedback.cs
- BamlRecordHelper.cs
- RunInstallerAttribute.cs
- XmlILIndex.cs
- NativeRecognizer.cs
- CodeDelegateInvokeExpression.cs
- LocalizableAttribute.cs
- MinimizableAttributeTypeConverter.cs
- RegexNode.cs
- AppDomainManager.cs