Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all 585 articles
Browse latest View live

Is their a API for getting the tab order of controls?

$
0
0

I am working on creating some UI Automation for a WPF application for my company and I would like to get the tab order of the controls on a form. Currently I am just sending the tab key to check the tab order and getting the focused control after a tab is sent. I would like to get the tab order and compare it to the previous tab order to tell if something changed.

I have access to the code and could probably expose this information through some kind of communication layer to inform my application about the tab order but would prefer to do this through an exposed windows API if one exists. Does anyone have any suggestions for getting the tab order with existing APIs?


Modal dialog using white ui automation

$
0
0
i have been struggling to upload a picture . by automation my dialog box is opened but suggest me how to select a picture and save that automatically 

Start applications snapped to left or right

$
0
0

Windows Shortcut files allow applications to be started maximised, restored (normal) or minimized. As snapped to the left or right are additional temporary window states, why not add them as options in the application's Shortcut tab, Run property dropdown?

Extending WSH and .NET Framework programming objects would allow creation of shortcuts and control of running applications.

WMI, WshShortcut Object, WindowStyle Property

intWindowStyle values:
1 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position.
3 Activates the window and displays it as a maximized window.
7 Minimizes the window and activates the next top-level window.

Request for two extra intWindowStyle values:
x Activates the window and displays it as a window snapped to the left.
y Activates the window and displays it as a window snapped to the right.

.NET Framework, System.Windows namespace, PresentationFramework assembly, WindowState Enumeration:
Maximized, Minimized, Normal

Request for two extra WindowState values:
SnappedLeft, SnappedRight

white core ui automation

$
0
0
how to convert white.core.uiitems.windowitems.window to system.windows.window

Narrator not reading the textblock's text consistently in windows phone 8.1 WinRT

$
0
0

I am working in a windows phone 8.1 winrt application in which i was asked to design controls to be screen readable. If narrator is enabled in windows phone, controls has to read their content when user access the controls in phone. After narrator is enabled, textblock is not reading the text consistently. It hardly reads the text for one or two times. But button, textbox & slider controls are reading their content smoothly.

To turn on narrator in windows phone (settings > ease of access > Narrator )

I had created a sample in windows phone 8.1 silverlight, in there textblock reads the text smoothly for all the time. 

But in windows 10 mobile also the textblock is not reading the text

My Sample Xaml code:

<TextBlock x:Name="display" TextWrapping="Wrap" Text=" textblock default reader" FontSize="30" AutomationProperties.Name="textblock automation reader"/><TextBox AutomationProperties.Name="Textbox automation reader"/><Slider Value="100" Name="slider" AutomationProperties.Name="Slider atomation reader"/><Button Content="button default reader" AutomationProperties.Name="button automation reader"/>

Note: In textblock & button, narrator reads the AutomationProperties.Name property. If the AutomationProperties.Name property is removed, it reads the 
Text and Content property respectively.

TextBox, Slider & Button:
For textbox, slider & button the narrator is reading the AutomationProperties.Name property in both silverlight(windows phone 8.1) & in winrt (windows phone 8.1 & windows 10 mobile) 

TextBlock:
But in winrt (windows phone 8.1 & windows 10 mobile) narrator is not reading the AutomationProperties.Name property at anytime, for text property it hardly reads for one or two time.

I refereed net for this issue, i had found one article which solves the textblock problem (in winrt) in our project by customizing the control. 

https://blogs.msdn.microsoft.com/jsocha/2012/11/20/making-a-textblock-in-a-datatemplate-accessible/

It is actually for accessing the textblock inside the data template. Anyway it solves the textblock accessibility problem. But for our project we are trying to solve it without customizing the control.

Is there any other way to make the textblock accessible?

Any help will be appreciated..



COM/COM+ or Windows Communication Foundation (WCF)?

$
0
0

We are developing a desktop application for Windows using C#. The application does some heavy calculation and drives specialized hardware. Our application should expose some functionality that third party applications can use out-of-process (i.e. server - client), which includes accessing data that lives in our application, or commanding our application to perform some actions. One of the reasons that we require this capability is to allow automation from third-party applications.

I have been looking into some possibilities to accomplish what we want but this topic is completely new for me so I thought the best would be to ask for advice to people with more experience. So far I have looked into COM/COM+ and Windows Communication Foundation (WCF). Both seem to offer the means to achieve what we need, but:

  • COM/COM+ : I know COM have been around for long, and most of the documentation I find is from a few years ago. I have nothing against that, I just wonder whether this is still the recommended way to go.
  • Windows Communication Foundation (WCF): I get the impression that WCF is used more in the context of web services and I have seen some concerns about performance when compared to COM (https://social.msdn.microsoft.com/Forums/vstudio/en-US/adb79021-89b8-47ab-a02d-33b2e777cb73/wcfcom-performance-comparison?forum=wcf)

For the record, I have also look into .Net Remoting, but it is not the recommended approach for new developments (https://msdn.microsoft.com/en-us/library/kwdt6w2k(v=vs.100).aspx)

What would be your advice on this matter? Is there another approach?

Thanks in advance!

could image icon on win32 tree control item node be identified by UI automation?

$
0
0
Hi all,

I notice that in http://msdn.microsoft.com/en-us/library/ms743384.aspx, it says that TreeItem could have zero or more child node such as image or checkbox.For standard win32 CTreeCtrl, we could set imagelist so that each treeitem could have a image icon.But now i could not find a child image node for each treeitem by using UISpy control view.

So i wonder that could such image icon be identified by UI automation automatically? if not, what is situation fitting for the link says that treeitem could have image or checkbox child node? 

If i want to find such a image child for CTreeControl,  could it possible to create a provider for it?

is there anyone could give some help? thank you!

alan

Looking for an IT app for tracking recurring maintenance jobs

$
0
0

Hello,

            I run a department that has multiple weekly, monthly tasks. (not everything can be automated) I’m looking for a web base application that manages these tasks for tracking.

For example:

  1. I.        As the manger, I would create a monthly task in the system. (an audit of account access the exchange servers)
    1.     I assign the tasks to one of my exchange admins
  2. II.        At that time of the month, the task system notifies the assigned admin of task. (with ETA’s)
  3. III.        Once the task is completed, the manger is notified to approved the work. (with in the system)

Anyone have any ideas on applications like this????

Thanks


Spell checking alt tags

$
0
0
I am a college teacher who is trying to make as much of my teaching accessible as possible. I write extensive alt-tags for all the pictures in my Powerpoint lectures. It drives me crazy to have to convert the Powerpoints to rich text or an accessible format and then go back in and correct the spelling. It is also a little irritating that the text in the alt tag box is so small that it is difficult to see errors. Can this be fixed?

Visual Studio 2012 Windows 7 UIAutomation

$
0
0

using System; using System.Windows.Automation; using System.Windows.Forms; namespace Sandbox083116 { public partial class Form1 : Form { private AutomationElement formAutomationElement; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { formAutomationElement = AutomationElement.FromHandle(Handle); } } }

I've saw a few posts about just ignoring first time exceptions if they are handled inside the windows dll's etc...

using System;
using System.Windows.Automation;
using System.Windows.Forms;

namespace Sandbox083116
{
public partial class Form1 : Form
{
private AutomationElement formAutomationElement;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
formAutomationElement = AutomationElement.FromHandle(Handle);
}
}
}

I have saw posts saying to ignore first time exceptions that are handled in windows .DLL files.  I was just curious if there is some method or additional information you could pass in this call to eliminate the exception?  I've tried my best to debug it, and got deep into the .NET Framework but, cannot step into the OLEACC.DLL file, well the assembly but that didn't help much.  It calls a function at some address....that the ends up handling the exception.  

//The call stack before the exception looks like this... First we are down to the fallback proxy...(ProxyManager.cs Line 554)

            // use the fallback proxy if there is one
            if (proxy == null)
            {
                proxy = FindProxyInEntryOrArrayList(ProxyScoping.FallbackHandlers, _fallbackHandlers, ref imageName, hwnd, idChild, idObject, null);
            }

//ProxyManager.cs (Line 630) in this case we have a count of 1, so it will only iterate through 1 time.
            // this is a for loop because we need this to be thread safe and ClientSideProviderFactoryCallback calls out
            // so there would have been a lock in force when the call out was made which causes
            // deadlock.  We need to make our locks as narrow as possible.
            for( int i = 0; i < count; i++ )
            {
                object entry;
                lock (_lockObj)
                {
                    entry = array[i];
                }

                proxy = GetProxyFromEntry(findType, entry, ref imageName, hwnd, idChild, idObject, classNameForPartialMatch);
                if( proxy != null )
                    break;
            }

            return proxy;
        }

//ProxyManager.cs (Line 714)
            // if we get an exception creating a proxy just don't create the proxy and let the UIAutomation default proxy be used
            // This will still allow the tree to be navigated  and some properties to be made availible.
            //

            try
            {
                return factoryCallback(hwnd, idChild, idObject);
            }

//MsaaNativeProvider.cs Line 105
            Accessible acc = Accessible.CreateNativeFromEvent(hwnd, idObject, idChild);


//Accessible (Line 127) (inside the Try/Catch)
        internal static Accessible CreateNativeFromEvent(IntPtr hwnd, int idObject, int idChild)
        {
            IntPtr zero = IntPtr.Zero;
            if (Environment.OSVersion.Version.Major >= 6)
            {
                zero = new IntPtr((long) MS.Win32.UnsafeNativeMethods.GetCurrentProcessId());
            }
            IntPtr lResult = Misc.ProxySendMessage(hwnd, 0x3d, zero, new IntPtr(idObject));
            if (lResult != IntPtr.Zero)
            {
                Accessibility.IAccessible ppvObject = null;
                int num = 1;
                try
                {
                    num = MS.Win32.UnsafeNativeMethods.ObjectFromLresult(lResult, ref MS.Win32.UnsafeNativeMethods.IID_IAccessible, zero, ref ppvObject);
                }

The last call to ObjectFromLresult, is a low level non-managed win32 call.  I cannot step into, I was unable to find any source code for I do have the symbols and I can stumble through assembly but, wasn't able to really pinpoint anything I could do different.  

This call is being made to help bring up a keyboard inside windows 10 when you click on a text box.  It is from a post: https://social.msdn.microsoft.com/Forums/silverlight/en-US/705c7ffc-f137-4e98-905c-8b3e8ba058ec/windows-10-tablet-mode-why-doesnt-winforms-textbox-show-the-onscreen-keyboard-if-getting-the?forum=winforms

A deeper dive from that post will find that https://social.msdn.microsoft.com/profile/dmitry%20lyalin%20(msft)/ came up with it, He claims 

This is NOT a formal sample from the Windows or WPF Product Team,  I’m merely a fan of WPF and wanted to get this code sample out to our community

  • While this is NOT a formal sample from Microsoft, at the same time it doesn’t use any hidden or unsupported API's, so developers that do their own research and testing can use this type of approach in their applications. Remember, this is just a sample!

This is his code that was converted 

            // Enables WPF to mark edit field as supporting text pattern (Automation Concept)
            System.Windows.Automation.AutomationElement asForm =
                System.Windows.Automation.AutomationElement.FromHandle(new WindowInteropHelper(this).Handle);

Brian Lagunas also has a different solution on http://brianlagunas.com/showing-windows-8-touch-keyboard-wpf/

Does anyone know a better solution?  Does anyone know how to avoid the exception?

Windows 7 64 bits office 2010 Dim c As New CUIAutomation not working (unable to set reference to uiautomationcore.dll)

$
0
0

Below I am unable to get this working in Excel 2010 under windows 7 as I am unable to set a reference to uiatuomatocore.dll.

Any suggestions to get this working from VBA

The easy (working) example in VBA (within Excel) under Windows XP with Automation API 3.0 installed (is XP + .NET 4)
the UIAutomationCore.DLL is an unmanaged DLL.

Sub test()
'      uuid(30CBE57D-D9D0-452A-AB13-7AC5AC4825EE) interface IUIAutomation    Dim c As New CUIAutomation                    'reference to IUIautomation object    Debug.Print c.GetRootElement.CurrentClassName 'Just to see if the basics work
End Sub

Output of above will be #32768 (the desktop)

RunTimeID is zero on the Toolbar button controls of winForm

$
0
0

Hi,

 When I am trying to access RunTimeId on button controls inside the toolbar of technology WinForm using method AutomationElement.GetRunTimeId() it is giving empty values but when I check with UISpy.exe the buttons have proper runtimeId.

Could you help me understand why this problem is coming and how to resolve???

Regards,

Nagasree.

 

 

GetRunTimeId on AutomationElement not giving correct value

$
0
0

Hi,

 When I am trying to access RunTimeId on button controls inside the toolbar of technology WinForm using method AutomationElement.GetRunTimeId() it is giving empty values but when I check with UISpy.exe the buttons have proper runtimeId.

Could you help me understand why this problem is coming and how to resolve???

Regards,

Nagasree.

 

HOWTO use C#/.NET UI-Automation with Chrome.

$
0
0

Please help,

I am using the UI-Automation with .NET/C# for IE and Edge, and now want to make it work for Chrome. I think I am past the UAC issues, but, I can not get any UI-Automation like "IUIAutomationElement:ElementFromPoint" to work with Chrome. After some research, I'm understanding that Chrome does have some UI-automation like "extensions" like a extension called "Selenium", but I'm not able to find anything that will let Microsoft's UI-Automation work with it.

How can one get UI-Automation work with Chrome?

HOWTO Deal with UAC vs UI-Automation.

$
0
0

Please help,

We have a C#/.NET apoplication that uses Interop.UIAutomationClient, and ultimately calls such functionality as the "ElementFromPoint" (https://msdn.microsoft.com/en-us/library/windows/desktop/ee671538(v=vs.85).aspx ).

We do not know how to deal with UAC User Account Control), if it were to block "ElementFromPoint" from working.

First off, there is no documentation in that link, to explain, what kind of error we would get back, if our app were to try and use "ElementFromPoint" on say IE11. Preferably, we'd get some error, saying UAC is at fault, contact you administrator to do X, Y, Z to let our application run UI-Automation on IE11.

After that, what would be the best approach for our app, to comply better with UAC, so that some administrator could identify it, as needing UAC acccess to say IE11.

EDIT...

If this will help clarify what we hope to learn, we'd like to know how to make UAC allow a specific C# application, that uses UI-Automation with such function calls as "ElementFromPoint", be allowed to run its UI-Automation functionality to say IE11. Preferably to know of a way that the C#can detect if it is allowed to run its UI-Automation, on say IE11, and if not, signal the user as what to do.



Regular Expressions in PropertyCondition objects

$
0
0
Does anyone know if support for Regular Expressions be added to the PropertyCondition class in a future update to the UI Automation Framework?

Say, for example, I am trying to write automated tests for an application where the title bar of the window changes depending on what screen is currently being displayed.  So the title bar text might look something like this:

MyUniquelyNamedApplication - Navigation View
MyUniquelyNamedApplication - Configuration View
MyUniquelyNamedApplication - Report View
etc.

If I wanted to write a function that could reliably obtain an AutomationElement for the main window of this application regardless of which screen is currently displayed, using a regular expression would seem the most logical approach, and would look something like this:

public AutomationElement GetAppWindow()
{
System.Text.RegularExpressions.Regex TitleBar = new Regex("MyUniquelyNamedApplication.*");
return AutomationElement.RootElement.FindFirst(TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, TitleBar));
}

Unfortunately, this code currently throws a System.ArgumentException.

Of course, if the application's main window had its Name property properly assigned I could search by AutomationIdProperty instead of NameProperty, but that's not always an option.

-Jesse Kindwall

edit: Wow, the code editor on this forum really does not like Firefox.  Formatting fixed.

Late binding CUIAutomation in VBA or VBSCRIPT

$
0
0

With references set in VBA I can do

dim c as new cuiautomation

but when I want to do it with createobject (for example from VBScript where I cannot set reference upfront) 

then i am unable to do

set c=createobject("cuiautomation") which so far is logical as there is no registry entry to do this with a clsid

Is it possible to use createobject with cuiautomation object to instantiate from VBScript (and other scripting languages)

In the Microsoft Mouse and Keyboard Center how do I set the "my favorites" keys (1, 2, etc) to a buit-in command?

$
0
0

Why are the built-in commands like "Logoff", "Lock Computer", "Search", etc. restricted from the "my favorites" keys labeled 1-5 in the Mouse and Keyboard Center. It seems that the my favorites numbered keys can only be changed from opening item number 1-5 on the taskbar to open a program, run a macro, or disable key. The other keys like the calculator key can be changed to the commands mentioned above as well as the open a program, run macro, or disable key.

I have a Microsoft Natural Ergonomic Keyboard 4000 V1.0 and Microsoft Mouse and Keyboard Center V2.3.188.0 running on Windows 8.1 Enterprise.

Please allow the all the commands that the other keys can do on the 1-5 keys and on the "my favorites star" key too.

This has been bugging me since Mouse and Keyboard Center was first released.

PS: It would be "nice" if you would bring back support for the "Trackball Explorer 1.0 PS2/USB Compatible" device (part number X08-70390). I have 2 of them (my third one died a while back) that I love!

Thanks,
SLDR
(Stephen L. De Rudder)

PS: Sorry if this is in the wrong forum. I found another post about Mouse and Keyboard Center here so I added mine.

How to use PXE Server to push a spefic installation(win10/win8/win7) to a spefic PC via MAC ID

$
0
0

Hi,

I've already used the MDT and WDS to do an PXE installtion test.

Currently the client can boot from PXE and will find the PXE server, then I need to chose which OS to install.

Can I do it like this:

1. If no request, the client will not start from PXE, the server will not broadcast to this MAC PC.

2. If has request, we can define the installation OS version before client booting. So after the client boot, everything will be automatically.

Can anyone have such try and give some hits how to implement it?

Thanks

HRESULT E_FAIL returned from call to COM component - UIAutomationClient

$
0
0

Hi,

We are using UIAVerify tool on Win 7 64 bit OS. While using this tool we get "HRESULT E_FAIL returned from COM" exception very often. Exception details are as,

System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at UIAutomationClient.IUIAutomationTreeWalker.GetFirstChildElementBuildCache()

Or

  at UIAutomationClient.IUIAutomationElement.BuildUpdatedCache()

Please inform if anyone has faced similar issues & how did it resolve. Also any idea on probable cause would be of much help.

Request to feel free to get back in case any more details are required.

Thanks in advance,

Ajay


Ajay

Viewing all 585 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>