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
- ByteAnimationBase.cs
- QueryMatcher.cs
- RecordConverter.cs
- BroadcastEventHelper.cs
- Input.cs
- FormViewUpdateEventArgs.cs
- GZipStream.cs
- CompilerState.cs
- StrokeNodeOperations2.cs
- DropShadowEffect.cs
- ScrollProviderWrapper.cs
- ToolBarButton.cs
- CqlParser.cs
- ViewDesigner.cs
- ParserContext.cs
- ComplexType.cs
- HttpProfileGroupBase.cs
- ReaderWriterLock.cs
- Config.cs
- ObjectStateFormatter.cs
- TypeToken.cs
- Vector3DCollectionValueSerializer.cs
- datacache.cs
- infer.cs
- XmlQuerySequence.cs
- BuildProvidersCompiler.cs
- ColumnCollection.cs
- EntityViewGenerator.cs
- ContextMenuAutomationPeer.cs
- TrackingProfileDeserializationException.cs
- PreviewKeyDownEventArgs.cs
- SecurityKeyIdentifierClause.cs
- TlsnegoTokenAuthenticator.cs
- ContractAdapter.cs
- dtdvalidator.cs
- TypeUtil.cs
- _LazyAsyncResult.cs
- TaskHelper.cs
- MouseOverProperty.cs
- Label.cs
- HMACSHA384.cs
- StrokeDescriptor.cs
- GridViewRowEventArgs.cs
- Constants.cs
- XmlEntity.cs
- SqlOuterApplyReducer.cs
- SqlCommandBuilder.cs
- SizeIndependentAnimationStorage.cs
- PointCollectionValueSerializer.cs
- ClientConvert.cs
- CodeObject.cs
- NotCondition.cs
- DataViewManagerListItemTypeDescriptor.cs
- ProtocolsConfigurationEntry.cs
- TreeWalker.cs
- ColorContextHelper.cs
- CodeDOMUtility.cs
- MouseButtonEventArgs.cs
- IApplicationTrustManager.cs
- XmlAnyElementAttributes.cs
- altserialization.cs
- EditorZoneAutoFormat.cs
- NameScope.cs
- ModifyActivitiesPropertyDescriptor.cs
- FixedStringLookup.cs
- ZipArchive.cs
- AtomParser.cs
- CollectionTraceRecord.cs
- SchemaImporterExtensionsSection.cs
- httpserverutility.cs
- HostProtectionPermission.cs
- FacetDescriptionElement.cs
- RefExpr.cs
- CultureMapper.cs
- CollectionDataContract.cs
- SqlAliasesReferenced.cs
- ToolStripDropDownClosedEventArgs.cs
- BitmapEffectInput.cs
- WebMessageEncodingBindingElement.cs
- CaseCqlBlock.cs
- MetabaseServerConfig.cs
- XpsManager.cs
- MouseActionConverter.cs
- HotCommands.cs
- QilInvoke.cs
- FileLogRecordEnumerator.cs
- _HTTPDateParse.cs
- CodeDelegateInvokeExpression.cs
- Dump.cs
- StorageEntitySetMapping.cs
- ManifestSignatureInformation.cs
- MarkupCompiler.cs
- CFStream.cs
- SiteMapPath.cs
- SecurityTokenParameters.cs
- XmlUtf8RawTextWriter.cs
- ContentControl.cs
- EntityDesignerUtils.cs
- VectorAnimationUsingKeyFrames.cs
- SmiTypedGetterSetter.cs