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
- PreparingEnlistment.cs
- DefaultPerformanceCounters.cs
- GPStream.cs
- Stack.cs
- LoginUtil.cs
- SimpleNameService.cs
- DataGridClipboardCellContent.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- VectorConverter.cs
- CssClassPropertyAttribute.cs
- XXXOnTypeBuilderInstantiation.cs
- TextRenderer.cs
- HttpClientCredentialType.cs
- HierarchicalDataBoundControlAdapter.cs
- PageWrapper.cs
- CellLabel.cs
- PageAsyncTaskManager.cs
- WebControlAdapter.cs
- PropertyPath.cs
- WindowsGraphics2.cs
- ObjectCloneHelper.cs
- Geometry3D.cs
- BaseCollection.cs
- NotFiniteNumberException.cs
- ResetableIterator.cs
- StylusPointPropertyInfoDefaults.cs
- InlineCategoriesDocument.cs
- ConsoleKeyInfo.cs
- ByteAnimation.cs
- CoreSwitches.cs
- PersonalizationStateInfoCollection.cs
- HttpResponseBase.cs
- WriteFileContext.cs
- NativeMethods.cs
- LayoutEvent.cs
- Lookup.cs
- FigureHelper.cs
- PropertyPushdownHelper.cs
- UndoUnit.cs
- WorkflowItemsPresenter.cs
- CatalogPartChrome.cs
- CFGGrammar.cs
- ExtenderProvidedPropertyAttribute.cs
- FieldBuilder.cs
- TypeHelper.cs
- SystemGatewayIPAddressInformation.cs
- WpfSharedBamlSchemaContext.cs
- UpdateCompiler.cs
- TransactionFormatter.cs
- AuthenticateEventArgs.cs
- UriExt.cs
- PhysicalAddress.cs
- EditingMode.cs
- EventLogQuery.cs
- SafeCryptoHandles.cs
- TypeGeneratedEventArgs.cs
- ConfigXmlSignificantWhitespace.cs
- AssemblyResourceLoader.cs
- TextRangeEdit.cs
- SponsorHelper.cs
- ActiveDesignSurfaceEvent.cs
- ShapingEngine.cs
- HttpRawResponse.cs
- UpdateCompiler.cs
- HideDisabledControlAdapter.cs
- MethodBuilderInstantiation.cs
- SplitterPanel.cs
- ServerType.cs
- FilteredReadOnlyMetadataCollection.cs
- InvalidProgramException.cs
- Aggregates.cs
- HwndSourceParameters.cs
- PersistenceException.cs
- ClientData.cs
- AffineTransform3D.cs
- ReservationNotFoundException.cs
- _ListenerAsyncResult.cs
- DurableMessageDispatchInspector.cs
- EndpointBehaviorElementCollection.cs
- RichTextBoxAutomationPeer.cs
- DefaultObjectMappingItemCollection.cs
- ToolStripTextBox.cs
- MembershipSection.cs
- XPathSelfQuery.cs
- MultiView.cs
- ActivityUtilities.cs
- CharConverter.cs
- SemanticKeyElement.cs
- SqlServices.cs
- invalidudtexception.cs
- FocusChangedEventArgs.cs
- UnsafeNativeMethods.cs
- MenuItem.cs
- PermissionToken.cs
- ConfigurationValue.cs
- PocoPropertyAccessorStrategy.cs
- GiveFeedbackEvent.cs
- XPathNavigatorReader.cs
- SignedXml.cs
- XPathNodeIterator.cs