Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- URL.cs
- AssociationEndMember.cs
- InfiniteIntConverter.cs
- WindowsScroll.cs
- SqlParameterizer.cs
- XmlSerializerSection.cs
- LookupBindingPropertiesAttribute.cs
- StorageMappingFragment.cs
- SQLInt32.cs
- TriState.cs
- HostingPreferredMapPath.cs
- SHA384Cng.cs
- CryptographicAttribute.cs
- ProcessThread.cs
- EntityDataSourceConfigureObjectContext.cs
- ReversePositionQuery.cs
- UnsafeNativeMethods.cs
- BooleanFacetDescriptionElement.cs
- LiteralText.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Expression.cs
- TreeNodeConverter.cs
- X509ChainElement.cs
- References.cs
- MenuItemStyle.cs
- SoapDocumentMethodAttribute.cs
- Conditional.cs
- FormCollection.cs
- VariableValue.cs
- MailMessage.cs
- InvokeSchedule.cs
- SaveFileDialog.cs
- ISAPIApplicationHost.cs
- XamlReader.cs
- VirtualizingStackPanel.cs
- TimeSpanSecondsConverter.cs
- OdbcEnvironmentHandle.cs
- XamlToRtfParser.cs
- RuntimeVariablesExpression.cs
- Menu.cs
- TemplatedAdorner.cs
- TransformCryptoHandle.cs
- EUCJPEncoding.cs
- FlowDecisionLabelFeature.cs
- RequestCacheEntry.cs
- GestureRecognizer.cs
- DefaultBindingPropertyAttribute.cs
- ControlPager.cs
- StrongNameUtility.cs
- Dispatcher.cs
- ValidationResult.cs
- PartManifestEntry.cs
- RoutedEventValueSerializer.cs
- StatusBarDesigner.cs
- DiscoveryDocumentSearchPattern.cs
- XmlCustomFormatter.cs
- PropertyDescriptorComparer.cs
- CharacterMetrics.cs
- SelectionGlyph.cs
- XPathDocumentBuilder.cs
- WhiteSpaceTrimStringConverter.cs
- ImageIndexConverter.cs
- RegexCaptureCollection.cs
- JpegBitmapDecoder.cs
- BooleanAnimationUsingKeyFrames.cs
- ChannelBinding.cs
- CodeSnippetTypeMember.cs
- URLMembershipCondition.cs
- UIPermission.cs
- RouteCollection.cs
- XmlTypeAttribute.cs
- DataBoundControlDesigner.cs
- DataBoundLiteralControl.cs
- GridViewSortEventArgs.cs
- GridViewColumnHeaderAutomationPeer.cs
- WCFServiceClientProxyGenerator.cs
- Activator.cs
- GetPageCompletedEventArgs.cs
- GenericEnumConverter.cs
- Accessors.cs
- InputLangChangeEvent.cs
- PeerPresenceInfo.cs
- KnownBoxes.cs
- BaseParser.cs
- Terminate.cs
- ShapeTypeface.cs
- HelpEvent.cs
- SqlDataReaderSmi.cs
- Pair.cs
- LinkDesigner.cs
- MulticastOption.cs
- TrustManagerMoreInformation.cs
- RandomNumberGenerator.cs
- Substitution.cs
- ConfigurationLockCollection.cs
- Win32Native.cs
- BaseConfigurationRecord.cs
- LogEntryHeaderv1Deserializer.cs
- ApplicationManager.cs
- AddingNewEventArgs.cs