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
- AsymmetricSignatureFormatter.cs
- DesignTimeVisibleAttribute.cs
- CellIdBoolean.cs
- PointF.cs
- GridViewColumnCollectionChangedEventArgs.cs
- AnnotationResourceCollection.cs
- autovalidator.cs
- PropertyGridEditorPart.cs
- ImageListStreamer.cs
- RoleGroup.cs
- MarkerProperties.cs
- FileReader.cs
- DataPager.cs
- DbDataSourceEnumerator.cs
- ObjectListFieldCollection.cs
- DrawingContextWalker.cs
- BaseInfoTable.cs
- CustomTypeDescriptor.cs
- SemanticResolver.cs
- SqlBulkCopy.cs
- PolicyException.cs
- Choices.cs
- DocumentsTrace.cs
- ProfileSection.cs
- NavigationCommands.cs
- DataFormat.cs
- StreamGeometry.cs
- HttpCapabilitiesEvaluator.cs
- StackBuilderSink.cs
- SequenceFullException.cs
- SplitterPanel.cs
- controlskin.cs
- ListViewItem.cs
- SemanticAnalyzer.cs
- DictionaryCustomTypeDescriptor.cs
- Helpers.cs
- PrintDialogException.cs
- UnknownBitmapEncoder.cs
- ActiveXHost.cs
- EpmCustomContentWriterNodeData.cs
- InputScopeAttribute.cs
- XmlSchemaAttributeGroupRef.cs
- FacetChecker.cs
- FloaterBaseParagraph.cs
- WsdlImporterElement.cs
- TextEndOfParagraph.cs
- ReferenceSchema.cs
- JsonFormatWriterGenerator.cs
- CommonXSendMessage.cs
- ProfileBuildProvider.cs
- Menu.cs
- SchemaNamespaceManager.cs
- WebPartDisplayModeCancelEventArgs.cs
- QilParameter.cs
- IDictionary.cs
- CombinedHttpChannel.cs
- _BaseOverlappedAsyncResult.cs
- NameValuePermission.cs
- ActivityInterfaces.cs
- EntityCommandExecutionException.cs
- FloaterBaseParagraph.cs
- PasswordPropertyTextAttribute.cs
- SpecialNameAttribute.cs
- HashHelper.cs
- SQLInt64Storage.cs
- UpdatePanelTrigger.cs
- QilExpression.cs
- ScriptingJsonSerializationSection.cs
- DataRelationCollection.cs
- FileIOPermission.cs
- SortDescription.cs
- MetadataCollection.cs
- SecurityValidationBehavior.cs
- CharConverter.cs
- OleDbParameter.cs
- ExtendedPropertyDescriptor.cs
- UIPermission.cs
- XmlFormatExtensionPointAttribute.cs
- MonitoringDescriptionAttribute.cs
- UpdateTranslator.cs
- PointHitTestParameters.cs
- Renderer.cs
- CroppedBitmap.cs
- CoTaskMemUnicodeSafeHandle.cs
- DodSequenceMerge.cs
- GridViewHeaderRowPresenter.cs
- ParsedAttributeCollection.cs
- MouseWheelEventArgs.cs
- MutexSecurity.cs
- ImmutableObjectAttribute.cs
- WebPartCollection.cs
- FrameworkContentElement.cs
- GiveFeedbackEvent.cs
- MaskDescriptor.cs
- BindUriHelper.cs
- NavigateEvent.cs
- InitializationEventAttribute.cs
- SystemPens.cs
- _LoggingObject.cs
- SrgsRule.cs