Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Integration / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ProjectionPath.cs
- EncoderParameters.cs
- DocComment.cs
- ContractCodeDomInfo.cs
- HotCommands.cs
- FontWeight.cs
- BuildResult.cs
- SqlUtils.cs
- Helpers.cs
- TransformerConfigurationWizardBase.cs
- Model3D.cs
- AnchoredBlock.cs
- ControlParameter.cs
- Enlistment.cs
- DBCSCodePageEncoding.cs
- XmlElementCollection.cs
- LabelTarget.cs
- DataBindingExpressionBuilder.cs
- HMACMD5.cs
- MultiBindingExpression.cs
- MouseBinding.cs
- TdsParameterSetter.cs
- AttributeData.cs
- FixedSOMTextRun.cs
- GregorianCalendarHelper.cs
- InstanceDescriptor.cs
- ImageKeyConverter.cs
- assertwrapper.cs
- recordstatefactory.cs
- SQLMembershipProvider.cs
- XmlSchemaAnnotation.cs
- CustomErrorsSection.cs
- UpdateManifestForBrowserApplication.cs
- HandlerBase.cs
- EventArgs.cs
- ListItemCollection.cs
- WmpBitmapEncoder.cs
- DummyDataSource.cs
- relpropertyhelper.cs
- SR.cs
- EllipticalNodeOperations.cs
- RegexGroupCollection.cs
- HttpApplicationFactory.cs
- Int32Rect.cs
- OutputChannelBinder.cs
- UnitySerializationHolder.cs
- SequentialOutput.cs
- DataControlPagerLinkButton.cs
- PolyBezierSegment.cs
- ClientTarget.cs
- SmiMetaData.cs
- RawStylusInputCustomData.cs
- GenericTypeParameterConverter.cs
- OrthographicCamera.cs
- DropDownList.cs
- EditorZone.cs
- LineGeometry.cs
- WaitHandle.cs
- KernelTypeValidation.cs
- DiagnosticsConfigurationHandler.cs
- SerializationSectionGroup.cs
- SpnEndpointIdentityExtension.cs
- ParameterElement.cs
- Rfc2898DeriveBytes.cs
- FileLoadException.cs
- DataServiceQueryProvider.cs
- CounterCreationDataCollection.cs
- StringTraceRecord.cs
- SettingsPropertyValueCollection.cs
- CqlLexerHelpers.cs
- SafeTimerHandle.cs
- dbenumerator.cs
- ReflectionHelper.cs
- SqlClientFactory.cs
- ExecutionTracker.cs
- UnmanagedMemoryStreamWrapper.cs
- ErrorHandler.cs
- ExceptionUtil.cs
- Substitution.cs
- SimpleApplicationHost.cs
- JapaneseCalendar.cs
- ParseChildrenAsPropertiesAttribute.cs
- __Error.cs
- CommonBehaviorsSection.cs
- AddInProcess.cs
- MimePart.cs
- CursorConverter.cs
- AuthorizationRuleCollection.cs
- CreateUserErrorEventArgs.cs
- ScrollData.cs
- MailDefinition.cs
- X509ChainElement.cs
- HttpAsyncResult.cs
- Char.cs
- DeclaredTypeElementCollection.cs
- Component.cs
- RepeatButtonAutomationPeer.cs
- HScrollProperties.cs
- ActionFrame.cs