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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ModuleBuilder.cs
- XpsSerializerFactory.cs
- AssemblyAttributesGoHere.cs
- MemberPath.cs
- FragmentQueryKB.cs
- Vector3DConverter.cs
- ZipIOExtraFieldZip64Element.cs
- ListControl.cs
- NewArrayExpression.cs
- XamlContextStack.cs
- OleDbRowUpdatedEvent.cs
- Attributes.cs
- Scheduler.cs
- MaskedTextBox.cs
- DisplayMemberTemplateSelector.cs
- ConsoleCancelEventArgs.cs
- ResourceDictionary.cs
- NamespaceMapping.cs
- TraceUtility.cs
- LowerCaseStringConverter.cs
- WinEventTracker.cs
- EdmProperty.cs
- ToolStripContentPanel.cs
- VersionPair.cs
- ProtocolsSection.cs
- IisTraceWebEventProvider.cs
- TraceEventCache.cs
- ConnectionStringSettingsCollection.cs
- DataControlFieldCollection.cs
- EditCommandColumn.cs
- DelegatingTypeDescriptionProvider.cs
- FunctionDescription.cs
- RequestCache.cs
- TraceSection.cs
- Pair.cs
- NotifyParentPropertyAttribute.cs
- DtrList.cs
- WithParamAction.cs
- DbConnectionOptions.cs
- XmlSchemas.cs
- TextSchema.cs
- AssemblyBuilder.cs
- HScrollBar.cs
- RTTypeWrapper.cs
- Delegate.cs
- MouseDevice.cs
- SQLBytes.cs
- EmissiveMaterial.cs
- PackageFilter.cs
- RotationValidation.cs
- JpegBitmapDecoder.cs
- TextTreeInsertUndoUnit.cs
- ResourceCategoryAttribute.cs
- WebDisplayNameAttribute.cs
- Utils.cs
- SystemIPGlobalProperties.cs
- IApplicationTrustManager.cs
- TokenizerHelper.cs
- TypeLibraryHelper.cs
- DropShadowEffect.cs
- PropertyIDSet.cs
- IBuiltInEvidence.cs
- StoragePropertyMapping.cs
- Membership.cs
- AxHost.cs
- CodeObject.cs
- XmlChildEnumerator.cs
- ThreadExceptionDialog.cs
- CommentEmitter.cs
- ChildrenQuery.cs
- DrawingContextWalker.cs
- HtmlControl.cs
- ButtonAutomationPeer.cs
- ObjectStorage.cs
- FactoryId.cs
- ObjectDataSourceView.cs
- DataGridViewButtonCell.cs
- SystemColors.cs
- OdbcEnvironmentHandle.cs
- DataSourceView.cs
- FormViewInsertEventArgs.cs
- ChannelBinding.cs
- OracleConnectionString.cs
- SoapSchemaExporter.cs
- WebPartEditorOkVerb.cs
- ExceptionHelpers.cs
- ReachDocumentSequenceSerializer.cs
- MailDefinition.cs
- Shape.cs
- panel.cs
- ObjectStateManagerMetadata.cs
- TypeDescriptionProviderAttribute.cs
- NameValueFileSectionHandler.cs
- _WinHttpWebProxyDataBuilder.cs
- CompilationAssemblyInstallComponent.cs
- TableColumn.cs
- ClientSettings.cs
- References.cs
- MessageBox.cs
- GridSplitterAutomationPeer.cs