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
- SendMailErrorEventArgs.cs
- BrowsableAttribute.cs
- EntityObject.cs
- DecimalKeyFrameCollection.cs
- SpellerStatusTable.cs
- SmtpFailedRecipientsException.cs
- CheckBox.cs
- SqlNodeAnnotations.cs
- Currency.cs
- AsyncCompletedEventArgs.cs
- ImageKeyConverter.cs
- Directory.cs
- TextSelection.cs
- CatalogPart.cs
- AbandonedMutexException.cs
- XPathSelectionIterator.cs
- DataConnectionHelper.cs
- InsufficientMemoryException.cs
- ObjectDataSourceEventArgs.cs
- ReaderOutput.cs
- DependencyPropertyValueSerializer.cs
- ChineseLunisolarCalendar.cs
- SmiRecordBuffer.cs
- XmlSerializationWriter.cs
- DbMetaDataCollectionNames.cs
- OuterGlowBitmapEffect.cs
- MdiWindowListStrip.cs
- GraphicsPathIterator.cs
- OdbcFactory.cs
- WeakReferenceList.cs
- AssemblySettingAttributes.cs
- DataServiceCollectionOfT.cs
- CopyNodeSetAction.cs
- GetPageCompletedEventArgs.cs
- _NestedMultipleAsyncResult.cs
- IOException.cs
- _UncName.cs
- ValidationEventArgs.cs
- AtomEntry.cs
- LinkDescriptor.cs
- TreeNodeStyleCollectionEditor.cs
- ColumnMapProcessor.cs
- DescendentsWalker.cs
- UrlMappingsSection.cs
- VScrollBar.cs
- UIElementCollection.cs
- FrameDimension.cs
- HitTestWithGeometryDrawingContextWalker.cs
- CodeDefaultValueExpression.cs
- DiscoveryClientChannelFactory.cs
- TemplateBindingExtensionConverter.cs
- StatusBarDrawItemEvent.cs
- HashAlgorithm.cs
- BackgroundFormatInfo.cs
- PageFunction.cs
- ToolboxItemLoader.cs
- FormViewRow.cs
- WSSecurityJan2004.cs
- CipherData.cs
- NetNamedPipeBindingCollectionElement.cs
- EventLogInternal.cs
- IsolatedStoragePermission.cs
- WindowsIPAddress.cs
- TypeContext.cs
- StaticExtension.cs
- CodeDOMUtility.cs
- VBCodeProvider.cs
- PagePropertiesChangingEventArgs.cs
- DisplayNameAttribute.cs
- StickyNote.cs
- ObjectCloneHelper.cs
- UrlPath.cs
- Random.cs
- TriState.cs
- DoubleIndependentAnimationStorage.cs
- ClientCultureInfo.cs
- ComAdminWrapper.cs
- CounterSetInstanceCounterDataSet.cs
- UpdateExpressionVisitor.cs
- PrimarySelectionAdorner.cs
- ActivityExecutionContextCollection.cs
- KnownBoxes.cs
- XamlTemplateSerializer.cs
- Html32TextWriter.cs
- ClientApiGenerator.cs
- GlobalAclOperationRequirement.cs
- RequestCachingSection.cs
- ColumnReorderedEventArgs.cs
- InternalBufferOverflowException.cs
- DeleteIndexBinder.cs
- RSAPKCS1SignatureDeformatter.cs
- GB18030Encoding.cs
- GeneralTransformGroup.cs
- NullableLongAverageAggregationOperator.cs
- UnsignedPublishLicense.cs
- Int64.cs
- ConfigurationLockCollection.cs
- QueryAsyncResult.cs
- ConfigurationManagerHelperFactory.cs
- MetaModel.cs