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
- ValueUnavailableException.cs
- Compress.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- QilExpression.cs
- ObjectMemberMapping.cs
- TextEndOfLine.cs
- ClientTargetCollection.cs
- VolatileEnlistmentState.cs
- PolyBezierSegment.cs
- FrugalMap.cs
- SimpleType.cs
- XsdDuration.cs
- MediaSystem.cs
- SQLInt32.cs
- AuthenticatingEventArgs.cs
- SharedUtils.cs
- ChtmlTextWriter.cs
- FontStretch.cs
- Activity.cs
- DataGridViewRowCancelEventArgs.cs
- PriorityBindingExpression.cs
- RoleServiceManager.cs
- LinqDataSourceDisposeEventArgs.cs
- CmsUtils.cs
- SimpleBitVector32.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- Zone.cs
- ResourceManager.cs
- PolygonHotSpot.cs
- SkewTransform.cs
- ClientSponsor.cs
- TaskCanceledException.cs
- XPathAxisIterator.cs
- GridSplitterAutomationPeer.cs
- DataSvcMapFile.cs
- SqlFacetAttribute.cs
- JournalEntryStack.cs
- ListBox.cs
- TraceHandler.cs
- ConnectionPoint.cs
- ToReply.cs
- PostBackTrigger.cs
- UIElementHelper.cs
- TagNameToTypeMapper.cs
- ListBindableAttribute.cs
- UnauthorizedWebPart.cs
- DateTimeValueSerializerContext.cs
- ListChangedEventArgs.cs
- EntityDataSourceStatementEditorForm.cs
- XpsImage.cs
- BindingWorker.cs
- Matrix3D.cs
- XmlAnyAttributeAttribute.cs
- ReflectionTypeLoadException.cs
- MdiWindowListStrip.cs
- ComponentSerializationService.cs
- MSAAWinEventWrap.cs
- Schema.cs
- Attributes.cs
- WorkflowOperationBehavior.cs
- Char.cs
- DrawingGroup.cs
- HtmlElementEventArgs.cs
- PeerObject.cs
- NameValueConfigurationElement.cs
- FileFormatException.cs
- RangeValuePattern.cs
- DataSourceCacheDurationConverter.cs
- XmlBoundElement.cs
- ProgressPage.cs
- BrowserCapabilitiesCodeGenerator.cs
- CurrencyWrapper.cs
- XmlIlGenerator.cs
- NameValueCollection.cs
- MouseOverProperty.cs
- FolderBrowserDialog.cs
- CollectionContainer.cs
- LinqDataSource.cs
- Point4DValueSerializer.cs
- MultiPropertyDescriptorGridEntry.cs
- RowToParametersTransformer.cs
- HtmlTable.cs
- BaseHashHelper.cs
- AlphabetConverter.cs
- SqlProfileProvider.cs
- HandledEventArgs.cs
- OdbcUtils.cs
- UnknownWrapper.cs
- RealProxy.cs
- ThreadSafeList.cs
- AmbientValueAttribute.cs
- Point3DConverter.cs
- CanonicalXml.cs
- SQLInt64.cs
- OutputCacheProfileCollection.cs
- XamlStackWriter.cs
- DefaultProfileManager.cs
- BoundsDrawingContextWalker.cs
- CmsUtils.cs
- LocalTransaction.cs