Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / AccessibleTech / longhorn / Automation / UIAutomationTypes / MS / Internal / Automation / UiaCoreTypesApi.cs / 1 / UiaCoreTypesApi.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description: Imports from unmanaged UiaCore DLL
//
// History:
// 06/02/2003 : [....] Ported to WCP
//
//---------------------------------------------------------------------------
using System;
using System.Security;
using System.Runtime.InteropServices;
using Microsoft.Internal;
namespace MS.Internal.Automation
{
internal static class UiaCoreTypesApi
{
//-----------------------------------------------------
//
// Other API types
//
//-----------------------------------------------------
#region Other
internal enum AutomationIdType
{
Property,
Pattern,
Event,
ControlType,
TextAttribute
}
internal const int UIA_E_ELEMENTNOTENABLED = unchecked((int)0x80040200);
internal const int UIA_E_ELEMENTNOTAVAILABLE = unchecked((int)0x80040201);
internal const int UIA_E_NOCLICKABLEPOINT = unchecked((int)0x80040202);
internal const int UIA_E_PROXYASSEMBLYNOTLOADED = unchecked((int)0x80040203);
#endregion Other
//------------------------------------------------------
//
// Internal Methods
//
//-----------------------------------------------------
#region Internal Methods
//
// Support methods...
//
///
/// Critical: This code calls into the unmanaged UIAutomationCore.dll
/// TreatAsSafe: This method simply converts a Guid representing an automation type to an int, making it safe to use.
///
[SecurityCritical,SecurityTreatAsSafe]
internal static int UiaLookupId(AutomationIdType type, ref Guid guid)
{
return RawUiaLookupId( type, ref guid );
}
///
/// Critical: This code calls into the unmanaged UIAutomationCore.dll
/// TreatAsSafe: This method only returns a fixed known object representing an Unsupported value, making it safe to use.
///
[SecurityCritical,SecurityTreatAsSafe]
internal static object UiaGetReservedNotSupportedValue()
{
object notSupportedValue;
CheckError(RawUiaGetReservedNotSupportedValue(out notSupportedValue));
return notSupportedValue;
}
///
/// Critical: This code calls into the unmanaged UIAutomationCore.dll
/// TreatAsSafe: This method only returns a fixed known object representing a MixedAttribute value, making it safe to use.
///
[SecurityCritical,SecurityTreatAsSafe]
internal static object UiaGetReservedMixedAttributeValue()
{
object mixedAttributeValue;
CheckError(RawUiaGetReservedMixedAttributeValue(out mixedAttributeValue));
return mixedAttributeValue;
}
#endregion Internal Methods
//------------------------------------------------------
//
// Private Methods
//
//------------------------------------------------------
#region Private Methods
// Check hresult for error...
private static void CheckError(int hr)
{
if (hr >= 0)
{
return;
}
Marshal.ThrowExceptionForHR(hr);
}
[SecurityCritical]
[SuppressUnmanagedCodeSecurity]
[DllImport(DllImport.UIAutomationCore, EntryPoint = "UiaLookupId", CharSet = CharSet.Unicode)]
private static extern int RawUiaLookupId(AutomationIdType type, ref Guid guid);
[SecurityCritical]
[SuppressUnmanagedCodeSecurity]
[DllImport(DllImport.UIAutomationCore, EntryPoint = "UiaGetReservedNotSupportedValue", CharSet = CharSet.Unicode)]
private static extern int RawUiaGetReservedNotSupportedValue([MarshalAs(UnmanagedType.IUnknown)] out object notSupportedValue);
[SecurityCritical]
[SuppressUnmanagedCodeSecurity]
[DllImport(DllImport.UIAutomationCore, EntryPoint = "UiaGetReservedMixedAttributeValue", CharSet = CharSet.Unicode)]
private static extern int RawUiaGetReservedMixedAttributeValue([MarshalAs(UnmanagedType.IUnknown)] out object mixedAttributeValue);
#endregion Private Methods
}
}
// 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
- ExpressionBuilderCollection.cs
- XPathItem.cs
- WebPartsPersonalizationAuthorization.cs
- GeneralTransform3DTo2D.cs
- HttpFileCollectionBase.cs
- XmlReader.cs
- Membership.cs
- HwndSourceKeyboardInputSite.cs
- BitVector32.cs
- Win32.cs
- Content.cs
- TextContainerChangedEventArgs.cs
- Utils.cs
- ResourceAttributes.cs
- SqlStatistics.cs
- ActiveXHost.cs
- DynamicRouteExpression.cs
- PopupRootAutomationPeer.cs
- PaintValueEventArgs.cs
- Transform.cs
- ValidatorCompatibilityHelper.cs
- VisemeEventArgs.cs
- HitTestFilterBehavior.cs
- GenericIdentity.cs
- ColumnCollection.cs
- ActivityXRefPropertyEditor.cs
- SiteMapNodeItem.cs
- DiagnosticsElement.cs
- OdbcDataAdapter.cs
- FamilyTypeface.cs
- ModelItemDictionary.cs
- KoreanCalendar.cs
- Binding.cs
- Cursor.cs
- RenderOptions.cs
- UnionCqlBlock.cs
- WindowsListViewItemStartMenu.cs
- messageonlyhwndwrapper.cs
- ProcessHostServerConfig.cs
- DecimalAnimation.cs
- SharedUtils.cs
- UIServiceHelper.cs
- StrokeFIndices.cs
- ExceptionUtil.cs
- TabletDevice.cs
- Roles.cs
- RegisterResponseInfo.cs
- DataStorage.cs
- CharStorage.cs
- TrackingMemoryStreamFactory.cs
- BamlBinaryReader.cs
- XmlSecureResolver.cs
- Claim.cs
- MembershipUser.cs
- XmlSchemaSimpleContentRestriction.cs
- CachedBitmap.cs
- GeometryDrawing.cs
- GPRECTF.cs
- ScriptingSectionGroup.cs
- MobileControlsSectionHandler.cs
- IdentityNotMappedException.cs
- ContentIterators.cs
- Rotation3DAnimationUsingKeyFrames.cs
- codemethodreferenceexpression.cs
- WorkflowPersistenceContext.cs
- Compiler.cs
- GridViewColumnCollection.cs
- GuidConverter.cs
- LockedAssemblyCache.cs
- WebControlAdapter.cs
- BitmapPalette.cs
- SyndicationDeserializer.cs
- XmlChildNodes.cs
- SystemUdpStatistics.cs
- HandleRef.cs
- SQLCharsStorage.cs
- NativeRightsManagementAPIsStructures.cs
- CommandEventArgs.cs
- SparseMemoryStream.cs
- PolygonHotSpot.cs
- Popup.cs
- Win32SafeHandles.cs
- NativeCompoundFileAPIs.cs
- WindowsGraphicsCacheManager.cs
- SiteMapPath.cs
- TransactionInformation.cs
- SafePEFileHandle.cs
- XmlEntityReference.cs
- ProtocolsConfiguration.cs
- DataGridViewCellFormattingEventArgs.cs
- MasterPageParser.cs
- ToolStripContentPanelRenderEventArgs.cs
- X509Extension.cs
- EntityDataReader.cs
- ConnectionPoolManager.cs
- DataGridViewCellFormattingEventArgs.cs
- SqlWriter.cs
- ManualResetEvent.cs
- ProfileModule.cs
- EventData.cs