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
- UndoUnit.cs
- CoTaskMemSafeHandle.cs
- StreamGeometryContext.cs
- PropertyPushdownHelper.cs
- PageCache.cs
- TransformPattern.cs
- ScriptingRoleServiceSection.cs
- DataGridAutomationPeer.cs
- Qualifier.cs
- DbgCompiler.cs
- HttpHeaderCollection.cs
- FixedStringLookup.cs
- BamlTreeNode.cs
- HtmlUtf8RawTextWriter.cs
- PrintController.cs
- ProcessRequestArgs.cs
- WindowsGraphics2.cs
- _NetworkingPerfCounters.cs
- WrappedIUnknown.cs
- GeneralTransform3DTo2DTo3D.cs
- TableAutomationPeer.cs
- SafeNativeMethods.cs
- FormDesigner.cs
- SubMenuStyle.cs
- HierarchicalDataBoundControl.cs
- CodeCatchClause.cs
- XmlSortKey.cs
- ellipse.cs
- ParameterBuilder.cs
- CodeGenHelper.cs
- ControlIdConverter.cs
- OleServicesContext.cs
- ConvertEvent.cs
- LinkedResource.cs
- WindowsSolidBrush.cs
- DelegateArgument.cs
- HttpWebRequestElement.cs
- Registry.cs
- ParameterCollectionEditor.cs
- EntityProxyFactory.cs
- EntityCollection.cs
- StartUpEventArgs.cs
- __TransparentProxy.cs
- PinnedBufferMemoryStream.cs
- TextEncodedRawTextWriter.cs
- LayoutEngine.cs
- DetailsViewRowCollection.cs
- Simplifier.cs
- DiagnosticStrings.cs
- handlecollector.cs
- Page.cs
- GridViewHeaderRowPresenter.cs
- TypeUtil.cs
- Module.cs
- VariableQuery.cs
- CompositeClientFormatter.cs
- ImageKeyConverter.cs
- BaseCodeDomTreeGenerator.cs
- DirectoryLocalQuery.cs
- AppSettings.cs
- SvcMapFileSerializer.cs
- SymbolPair.cs
- ToolStripArrowRenderEventArgs.cs
- SimpleTextLine.cs
- ServerValidateEventArgs.cs
- DrawingAttributesDefaultValueFactory.cs
- CellTreeSimplifier.cs
- WebPartConnectionsCancelEventArgs.cs
- DateTimeFormatInfoScanner.cs
- StrongNameUtility.cs
- BamlCollectionHolder.cs
- RegistryConfigurationProvider.cs
- SymmetricKeyWrap.cs
- FileChangesMonitor.cs
- ScriptReference.cs
- CacheOutputQuery.cs
- PlaceHolder.cs
- QuaternionKeyFrameCollection.cs
- OutputCacheProfileCollection.cs
- Base64Decoder.cs
- UserControlBuildProvider.cs
- XmlTextReaderImplHelpers.cs
- ShaperBuffers.cs
- ToolStripPanelRenderEventArgs.cs
- EmptyControlCollection.cs
- SpellerError.cs
- TextBoxView.cs
- CallbackValidator.cs
- ByteAnimation.cs
- NameValuePermission.cs
- SafeWaitHandle.cs
- WizardPanel.cs
- FullTrustAssembliesSection.cs
- ConfigXmlElement.cs
- SQLInt64Storage.cs
- DataGridViewControlCollection.cs
- DataGridViewDataErrorEventArgs.cs
- TreeBuilderBamlTranslator.cs
- WizardPanelChangingEventArgs.cs
- WebServiceBindingAttribute.cs