Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / AccessibleTech / longhorn / Automation / Win32Providers / MS / Internal / AutomationProxies / SafeThemeHandle.cs / 1 / SafeThemeHandle.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // // History: // 10/04/2003 : [....] Created //--------------------------------------------------------------------------- using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; //using System.Runtime.CompilerServices; using System.Windows.Automation; using Microsoft.Win32.SafeHandles; using MS.Win32; namespace MS.Internal.AutomationProxies { internal sealed class SafeThemeHandle : SafeHandleZeroOrMinusOneIsInvalid { // This constructor is used by the P/Invoke marshaling layer // to allocate a SafeHandle instance. P/Invoke then does the // appropriate method call, storing the handle in this class. private SafeThemeHandle() : base(true) {} // Uncomment this if & only if we need a constructor // that takes a handle from external code internal SafeThemeHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) { SetHandle(preexistingHandle); } // protected override bool ReleaseHandle() { // MustRun methods may only call other MustRun methods, // must not allocate along paths that must succeed, etc. return !IsInvalid ? CloseThemeData(handle) == (IntPtr)NativeMethods.S_OK : true; } [DllImport("UxTheme.dll", CharSet = CharSet.Auto)/*, SuppressUnmanagedCodeSecurity*/] // private static extern IntPtr CloseThemeData(IntPtr handle); } } // 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
- HierarchicalDataSourceConverter.cs
- KeyboardEventArgs.cs
- UrlMappingCollection.cs
- figurelengthconverter.cs
- FaultHandlingFilter.cs
- StorageAssociationTypeMapping.cs
- DependencyPropertyConverter.cs
- StreamGeometryContext.cs
- ConfigurationHandlersInstallComponent.cs
- ParseChildrenAsPropertiesAttribute.cs
- MemberAccessException.cs
- TextChangedEventArgs.cs
- XmlWrappingReader.cs
- DocumentGrid.cs
- ControlType.cs
- Vector.cs
- ActivityDesignerHighlighter.cs
- ConstNode.cs
- _ListenerRequestStream.cs
- DataStreamFromComStream.cs
- IdnMapping.cs
- XmlILTrace.cs
- SqlInternalConnectionTds.cs
- WsdlInspector.cs
- HttpRawResponse.cs
- ContentDesigner.cs
- ConfigurationStrings.cs
- NavigationCommands.cs
- FormViewCommandEventArgs.cs
- HttpCookieCollection.cs
- TextEditorLists.cs
- DefaultProxySection.cs
- ViewSimplifier.cs
- VoiceInfo.cs
- Array.cs
- HttpListener.cs
- HashAlgorithm.cs
- IResourceProvider.cs
- MouseBinding.cs
- NonVisualControlAttribute.cs
- DropAnimation.xaml.cs
- GestureRecognitionResult.cs
- FormViewPageEventArgs.cs
- SqlClientWrapperSmiStream.cs
- _NestedSingleAsyncResult.cs
- ActivityExecutionContextCollection.cs
- SimpleType.cs
- RenderingEventArgs.cs
- StateMachine.cs
- Knowncolors.cs
- WebControlsSection.cs
- DataServiceResponse.cs
- FrameworkElementAutomationPeer.cs
- Viewport3DAutomationPeer.cs
- WebSysDefaultValueAttribute.cs
- TableLayout.cs
- DataServiceConfiguration.cs
- Cursor.cs
- MailMessageEventArgs.cs
- WindowsTokenRoleProvider.cs
- TypeInfo.cs
- HttpApplicationStateBase.cs
- WindowsPen.cs
- InputLanguageProfileNotifySink.cs
- TextDataBindingHandler.cs
- ProxyGenerationError.cs
- PropertyCondition.cs
- SecurityTokenException.cs
- DataSetUtil.cs
- SimpleTableProvider.cs
- BinarySerializer.cs
- NavigationProgressEventArgs.cs
- WindowsAuthenticationEventArgs.cs
- TextFormatterImp.cs
- SchemaContext.cs
- CollectionChangeEventArgs.cs
- NamespaceCollection.cs
- MenuItem.cs
- FixedDSBuilder.cs
- MetafileHeaderWmf.cs
- LineSegment.cs
- ByteAnimationBase.cs
- Receive.cs
- CultureTable.cs
- IdentifierElement.cs
- XmlElementCollection.cs
- EntitySetRetriever.cs
- HwndMouseInputProvider.cs
- safesecurityhelperavalon.cs
- TdsParser.cs
- LiteralControl.cs
- X509SecurityToken.cs
- ContractUtils.cs
- UIElement3DAutomationPeer.cs
- SharedPersonalizationStateInfo.cs
- DesignerSerializationVisibilityAttribute.cs
- regiisutil.cs
- ReadWriteObjectLock.cs
- PropertyGrid.cs
- AccessDataSource.cs