Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Aggregates.cs
- DataRowExtensions.cs
- OleDbConnection.cs
- AccessViolationException.cs
- EntityCollectionChangedParams.cs
- RawStylusInputCustomData.cs
- DataGridItemAutomationPeer.cs
- GridEntryCollection.cs
- ExtendedProperty.cs
- HttpListener.cs
- RIPEMD160.cs
- Clock.cs
- DataGridCellAutomationPeer.cs
- ServiceElement.cs
- GC.cs
- DataListItemEventArgs.cs
- IgnoreDataMemberAttribute.cs
- ParseChildrenAsPropertiesAttribute.cs
- Win32MouseDevice.cs
- StoragePropertyMapping.cs
- UTF7Encoding.cs
- DesigntimeLicenseContextSerializer.cs
- DataSet.cs
- DetailsViewUpdatedEventArgs.cs
- OrderedDictionary.cs
- TypeResolvingOptionsAttribute.cs
- AssemblyAssociatedContentFileAttribute.cs
- DataGridViewTextBoxEditingControl.cs
- FormatSettings.cs
- DbXmlEnabledProviderManifest.cs
- MonthChangedEventArgs.cs
- VersionedStreamOwner.cs
- InstanceDataCollection.cs
- updateconfighost.cs
- LightweightCodeGenerator.cs
- CodeSnippetTypeMember.cs
- AppearanceEditorPart.cs
- Iis7Helper.cs
- EventDescriptor.cs
- ObjectViewListener.cs
- CharUnicodeInfo.cs
- IxmlLineInfo.cs
- Page.cs
- MatrixUtil.cs
- SqlDataSourceCommandEventArgs.cs
- SponsorHelper.cs
- RawMouseInputReport.cs
- XmlNode.cs
- CodeSnippetStatement.cs
- ImpersonateTokenRef.cs
- SignatureResourcePool.cs
- AlphabeticalEnumConverter.cs
- GenerateTemporaryTargetAssembly.cs
- MergeFailedEvent.cs
- DecimalFormatter.cs
- HtmlHistory.cs
- SqlCacheDependency.cs
- EnumMember.cs
- RsaKeyIdentifierClause.cs
- NestPullup.cs
- RequestQueue.cs
- RandomNumberGenerator.cs
- FillBehavior.cs
- ToolStripPanelRenderEventArgs.cs
- ListView.cs
- XmlDataProvider.cs
- RuleSetBrowserDialog.cs
- FontInfo.cs
- DataBindingCollection.cs
- ImpersonateTokenRef.cs
- SkipQueryOptionExpression.cs
- ProtocolsInstallComponent.cs
- EdmItemCollection.cs
- EnumConverter.cs
- FastPropertyAccessor.cs
- ErrorEventArgs.cs
- DbReferenceCollection.cs
- x509utils.cs
- _WinHttpWebProxyDataBuilder.cs
- Base64Decoder.cs
- ContextQuery.cs
- XPathSelectionIterator.cs
- ActivationArguments.cs
- QueryableDataSourceHelper.cs
- OleDbSchemaGuid.cs
- ByteAnimationUsingKeyFrames.cs
- AdornerPresentationContext.cs
- GeneralTransform3DTo2DTo3D.cs
- RowType.cs
- TextEffectCollection.cs
- ProfileParameter.cs
- ItemsChangedEventArgs.cs
- DataGridViewTextBoxEditingControl.cs
- XComponentModel.cs
- ChoiceConverter.cs
- UserPersonalizationStateInfo.cs
- SelectingProviderEventArgs.cs
- RichTextBox.cs
- ConfigurationPropertyAttribute.cs
- PanelDesigner.cs