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
- ProjectionRewriter.cs
- SqlParameterCollection.cs
- XmlReaderSettings.cs
- FormsAuthentication.cs
- MenuItemBindingCollection.cs
- MediaSystem.cs
- DrawingContextWalker.cs
- FontStyle.cs
- UrlPropertyAttribute.cs
- DeadCharTextComposition.cs
- VariantWrapper.cs
- PropertyGeneratedEventArgs.cs
- GreenMethods.cs
- ZoomComboBox.cs
- Point4DValueSerializer.cs
- FileEnumerator.cs
- ErrorLog.cs
- SiteMap.cs
- UiaCoreApi.cs
- EnumType.cs
- HuffModule.cs
- WSUtilitySpecificationVersion.cs
- SQLString.cs
- PageTrueTypeFont.cs
- GeneralTransform2DTo3DTo2D.cs
- Thread.cs
- PartialCachingAttribute.cs
- AttributeEmitter.cs
- AppSettingsExpressionBuilder.cs
- ColorMatrix.cs
- StorageSetMapping.cs
- ProgressBar.cs
- EmbeddedMailObjectsCollection.cs
- Model3D.cs
- NamespaceDisplayAutomationPeer.cs
- Listbox.cs
- UriTemplateTable.cs
- AdapterUtil.cs
- SafeRightsManagementHandle.cs
- DataServiceQueryException.cs
- DataGridRelationshipRow.cs
- parserscommon.cs
- DBConcurrencyException.cs
- BitStream.cs
- CodeTypeReference.cs
- WebCodeGenerator.cs
- FileNotFoundException.cs
- FrameDimension.cs
- DiscoveryClientRequestChannel.cs
- MarshalDirectiveException.cs
- XmlSchemaSimpleTypeRestriction.cs
- MessageSecurityException.cs
- SessionStateUtil.cs
- ASCIIEncoding.cs
- ControlIdConverter.cs
- CodeChecksumPragma.cs
- MaterialGroup.cs
- PolyLineSegment.cs
- UnhandledExceptionEventArgs.cs
- UpdateEventArgs.cs
- TableParagraph.cs
- LinkLabelLinkClickedEvent.cs
- PointLightBase.cs
- Literal.cs
- SQLInt64Storage.cs
- SqlCommandSet.cs
- DbException.cs
- TextBoxAutoCompleteSourceConverter.cs
- CompositeFontParser.cs
- Misc.cs
- CatalogZone.cs
- EventLogPermissionAttribute.cs
- SubclassTypeValidatorAttribute.cs
- UmAlQuraCalendar.cs
- QueryLifecycle.cs
- CompositeFontFamily.cs
- SHA256.cs
- FileLogRecordStream.cs
- _SecureChannel.cs
- EventRouteFactory.cs
- XmlTypeAttribute.cs
- _AutoWebProxyScriptHelper.cs
- SqlFormatter.cs
- TypeConverters.cs
- WindowsScrollBarBits.cs
- ReaderWriterLock.cs
- StringKeyFrameCollection.cs
- Executor.cs
- StateMachineHelpers.cs
- PerformanceCounterPermissionEntryCollection.cs
- ScalarType.cs
- ListViewUpdateEventArgs.cs
- TextParagraphView.cs
- GradientBrush.cs
- HandlerBase.cs
- ManagedFilter.cs
- MetadataCacheItem.cs
- XamlNamespaceHelper.cs
- DataSourceXmlElementAttribute.cs
- Socket.cs