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
- Processor.cs
- OpCopier.cs
- TriggerBase.cs
- TextBox.cs
- IResourceProvider.cs
- validation.cs
- TraceRecords.cs
- URLEditor.cs
- XmlCharacterData.cs
- XmlSchemaCompilationSettings.cs
- WizardPanelChangingEventArgs.cs
- SerializationObjectManager.cs
- TagPrefixCollection.cs
- SafeFileMappingHandle.cs
- ProcessModuleCollection.cs
- _DigestClient.cs
- mda.cs
- RelationshipFixer.cs
- ISAPIRuntime.cs
- HttpCookiesSection.cs
- DelegatedStream.cs
- SoapFormatExtensions.cs
- ContentPresenter.cs
- PackWebRequestFactory.cs
- RichTextBox.cs
- DispatchWrapper.cs
- OleDbReferenceCollection.cs
- UxThemeWrapper.cs
- SHA256.cs
- CodeSubDirectoriesCollection.cs
- LinkArea.cs
- OdbcConnectionOpen.cs
- StringCollection.cs
- ReadOnlyAttribute.cs
- WmlObjectListAdapter.cs
- CollectionView.cs
- RegexStringValidator.cs
- Italic.cs
- FrameworkContentElement.cs
- TransactionManager.cs
- AssemblyCollection.cs
- BinaryOperationBinder.cs
- PropertyToken.cs
- XmlSerializerSection.cs
- DetailsViewInsertedEventArgs.cs
- WorkflowTransactionService.cs
- XsltArgumentList.cs
- _Semaphore.cs
- RtfFormatStack.cs
- ArrayList.cs
- RepeatButtonAutomationPeer.cs
- AtomMaterializer.cs
- MetaModel.cs
- DesignerDataTableBase.cs
- DataTableReaderListener.cs
- MessageContractImporter.cs
- _SafeNetHandles.cs
- EndpointIdentityConverter.cs
- CodeConstructor.cs
- Socket.cs
- _AcceptOverlappedAsyncResult.cs
- IsolatedStorage.cs
- BooleanAnimationUsingKeyFrames.cs
- PerfCounters.cs
- AttachedPropertyMethodSelector.cs
- EventSetterHandlerConverter.cs
- TextBox.cs
- ProgressBarBrushConverter.cs
- Size3D.cs
- XmlSchemaSimpleTypeList.cs
- AppDomainInfo.cs
- XmlMapping.cs
- CookielessHelper.cs
- CacheVirtualItemsEvent.cs
- DoubleCollectionConverter.cs
- FtpCachePolicyElement.cs
- IgnoreSectionHandler.cs
- CompositeActivityMarkupSerializer.cs
- QuadraticEase.cs
- XmlNamespaceMapping.cs
- SessionIDManager.cs
- StateItem.cs
- HashMembershipCondition.cs
- NameTable.cs
- SqlNotificationRequest.cs
- CriticalHandle.cs
- Select.cs
- ControlAdapter.cs
- PassportAuthenticationModule.cs
- OdbcConnection.cs
- SynchronizationContext.cs
- HttpModuleCollection.cs
- WebBrowserNavigatedEventHandler.cs
- KnownTypesProvider.cs
- Graphics.cs
- StringUtil.cs
- ShaderEffect.cs
- XPathAncestorQuery.cs
- KeyPullup.cs
- SkinBuilder.cs