Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / SafeThemeHandle.cs / 1305600 / 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
- RemoteWebConfigurationHost.cs
- TraceSwitch.cs
- UpdatePanel.cs
- PlainXmlWriter.cs
- CellParaClient.cs
- LogLogRecord.cs
- OleDbErrorCollection.cs
- _HelperAsyncResults.cs
- StrokeNodeOperations2.cs
- ValueOfAction.cs
- TimeBoundedCache.cs
- Drawing.cs
- DES.cs
- StdValidatorsAndConverters.cs
- SystemPens.cs
- SettingsPropertyWrongTypeException.cs
- HttpServerVarsCollection.cs
- SequenceDesigner.cs
- AllMembershipCondition.cs
- MonitoringDescriptionAttribute.cs
- AssemblyNameProxy.cs
- DictionaryTraceRecord.cs
- Model3DGroup.cs
- WindowsListViewSubItem.cs
- HandlerElement.cs
- IndexedString.cs
- TextPenaltyModule.cs
- XmlEntityReference.cs
- SqlDataSourceView.cs
- CustomError.cs
- TiffBitmapEncoder.cs
- Transform3DGroup.cs
- RepeatInfo.cs
- XmlSchemaSimpleContentRestriction.cs
- Module.cs
- TimeSpanConverter.cs
- ObjectDataSourceFilteringEventArgs.cs
- CompositeFontInfo.cs
- WebPartDescriptionCollection.cs
- SslStream.cs
- Wizard.cs
- FileUtil.cs
- WebPartVerbCollection.cs
- TextRunTypographyProperties.cs
- SingleResultAttribute.cs
- RepeatInfo.cs
- EncoderExceptionFallback.cs
- IApplicationTrustManager.cs
- DesignConnectionCollection.cs
- SemanticBasicElement.cs
- Zone.cs
- DragEvent.cs
- HtmlHistory.cs
- PermissionToken.cs
- TransactionScope.cs
- XNodeValidator.cs
- PngBitmapEncoder.cs
- OciEnlistContext.cs
- WebBaseEventKeyComparer.cs
- MenuItemBinding.cs
- RelationalExpressions.cs
- DataGridViewRowHeaderCell.cs
- InkCanvasAutomationPeer.cs
- PointLight.cs
- ExceptionCollection.cs
- AppModelKnownContentFactory.cs
- ClassValidator.cs
- Win32.cs
- RequiredAttributeAttribute.cs
- AudioSignalProblemOccurredEventArgs.cs
- ToolBarButtonClickEvent.cs
- FontStretches.cs
- _IPv4Address.cs
- CodeDelegateCreateExpression.cs
- ConfigXmlText.cs
- NavigationPropertyAccessor.cs
- BindingSource.cs
- IdentifierService.cs
- Tablet.cs
- WorkflowItemsPresenter.cs
- ReturnEventArgs.cs
- XmlDictionaryWriter.cs
- MissingManifestResourceException.cs
- ListSortDescriptionCollection.cs
- HttpServerVarsCollection.cs
- TrackingConditionCollection.cs
- Utils.cs
- TriggerAction.cs
- StaticTextPointer.cs
- ServerValidateEventArgs.cs
- Double.cs
- RoutedEventConverter.cs
- AbstractDataSvcMapFileLoader.cs
- UpDownEvent.cs
- DataGridViewCellStyleEditor.cs
- SystemResourceHost.cs
- X500Name.cs
- OracleDataAdapter.cs
- JoinSymbol.cs
- DesignTimeParseData.cs