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

Inconsistent Menu opened event notifications

$
0
0

Hi everyone,

I am monitoring MENU opened events (UIA_MenuOpenedEventId) globally by adding AddAutomationEventHandler with Treescope_Descendants and the element hooked is for the root (Desktop). Things work fine to an extent and I have problems of notifications being inconsistent. My target platform is Win8 Desktop.

Is this the expected behaviour? All suggestions are welcome and it is well appreciated.

Thank you.

Best regards,

Jay


Can we use UIA to control and spy Store App ?

$
0
0

Hi

Is there some forum to discuss Store App automation ?

Can we use UIA C++ and C# to control Store App ?

Is there some good sample from Microsoft or 3rd party ?

Is there some good tool to spy Store App windows and controls ?n

Thank for your kind guidance .

How to un-tile your program when the onscreen keyboard is removed?

$
0
0

In at least Windows 8, at certain resolutions (a MS Surface Pro, for example, 1920 x 1080 with "Larger - 150%"), if a desktop program is maximized (or would otherwise intrude on the onscreen keyboard space) and the onscreen keyboard is activatedand the onscreen keyboard is maximized (or subsequently maximized), then that forces our desktop program to be tiled above the maximized onscreen keyboard. All is well, until the onscreen keyboard is restored to its non-maximized size or dismissed. We'd like our desktop program to resize itself to its original position. But we're having a difficult time finding out how to get a notification that we can resume our original size.

Any suggestions?

(If this is in the wrong forum, feel free to relocate.)

Thanks!

Select a row of datagrid using UI Automation

$
0
0

Hi,

I'm writing a UI automation software for another software. I need to select a row in the datagrid and then click on the run button. I tried most of the example codes in the internet and each time wasn't successful. For example for selecting a gridview row:

When I write the following code:

AutomationElement dataGrid =  this.mainWindow.FindFirst(TreeScope.Children,
new PropertyCondition(AutomationElement.AutomationIdProperty, "2885"));
if (dataGrid != null)
{

    GridPattern pattern = GetGridPattern(dataGrid);

    AutomationElement tempElement = pattern.GetItem(1, 1);
                tempElement.SetFocus();
}

I receive the error: "Target element cannot receive focus." which is related to the last line.

I also tried the code:

AutomationElement mainGrid = // find the grid in the window
var columnCount = (int)mainGrid.GetCurrentPropertyValue(GridPattern.ColumnCountProperty);
var mainGridPattern = (GridPattern)mainGrid.GetCurrentPattern(GridPattern.Pattern);

var rowToSelect = 2;

// select just the first cell
var item = mainGridPattern.GetItem(rowToSelect, 0);
var itemPattern = (SelectionItemPattern)item.GetCurrentPattern(SelectionItemPattern.Pattern);
itemPattern.Select();

but I and I received the error :"Unsupported Pattern".

I should mention that I'm using UI Spy for retrieving the elements properties. I have attached a picture of UI Spy showing this datagrid properties.

Could you explain me what's wrong and how should I select a row?




Have a question regarding automation of Memory Testing

$
0
0
Hello,

We are working on automating memory testing and ran into a problem where it appears that the automation interfaces are holding references to controls within our application. This gives us a bogus reading in the memory profiler. After investigating, it appears as though the UIAutomation bridge is using remoting to retrieve references to the controls in our application.

We also found that putting in a Thread.Sleep for 2 minutes before taking each memory snapshot fixes this issue.

My question is, can you confirm that remoting is being used to communicate with controls? And if so, is there any way to set the timout to sever the connection on command?

Thanks,

Mike
Mike Watkins

SendInput fail beause Interface Privilege Isolation (UIPI) and integrity

$
0
0
I am try to simulate mouse event on Win7, and my application using an open source project "Windows Input Simulator" on website http://inputsimulator.codeplex.com/ which internally use codes below to simulate mouse event:

[DllImport("user32.dll", SetLastError = true)]

public static extern UInt32 SendInput(UInt32 numberOfInputs, INPUT[] inputs, Int32 sizeOfInputStructure);


My application runs perfectly when I debug it with Visual Studio 2010. The left button click event, right button click event and mouse move event are ok. But the click events not send when I start my application from Explorer by double click the .exe application excutable file. Only the mouse move event is OK, if I try to simulate left button click or right click, my application will receive an exception and exit.
I have found the exception is throw by codes below:
public void DispatchInput(INPUT[] inputs)
{
    if (inputs == null) throw new ArgumentNullException("inputs");
    if (inputs.Length == 0) throw new ArgumentException("The input array was empty", "inputs");
    var successful = NativeMethods.SendInput((UInt32)inputs.Length, inputs, Marshal.SizeOf(typeof (INPUT)));
    if (successful != inputs.Length)
            throw new Exception("Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.");
}

That says UIPI blocked the SendInput(...). So I Google this topic, and get some advises.

1) Add uiAccess="true" to my application's manifest
<requestedExecutionLevel level="requireAdministrator" uiAccess="true" />

2) Create a test certificate and add this certificate to local machine Trusted Root Certification Authorities certificate store and the Trusted Publishers certificate store.
MakeCert -r -pe -ss PrivateCertStore -n "CN=Test Certificate - For Internal Use Only" testcert.cer
CertMgr.exe /add testcert.cer /s /r localMachine root
CertMgr.exe /add testcert.cer /s /r localMachine trustedpublisher

3) Sign my application with previous digital signature
    
SignTool sign /v /s PrivateCertStore /n "Test Certificate - For Internal Use Only" /t http://timestamp.verisign.com/scripts/timestamp.dll MyApplication.exe
4) Install my application to "C:\Program Files" folder which is one of the secure locations on my computer.

I think I have done all things to satisfy UIPI requirements, but the problem still not solve after I start my application and agree the UAC prompt. Only mouse move event is ok.

PS: if I don't sign my application with test certificate and only add "requestedExecutionLevel" with uiAccess="true" in manifest, application will not start and Windows show a dialog with message "A referral was returned from the server.". If I signed my application with test certificate, UAC will work when I start my application. The application will work until I call SendInput to simulate click event and then exception threw.

I have read the requirements about "Interface Privilege Isolation (UIPI) and integrity" at http://msdn.microsoft.com/en-us/library/bb625963.aspx, but after doing all this, still not work.

Any one can help me about this?

Exception in UI Automation Client

$
0
0

Hi,

We've developed app(app 1), that interacts with controls of other applications (app 2). App 1 is using the UI Automation accessibility framework.

If app 2 throws some exception, it catchs in app 1.

Is there a way to understand in which application exception was thrown?

Thank you in advance.

Windows help compiler

$
0
0

Hi there!

I`m trying to compile windows help from command line but when I run hhc.exe I just got an error:

HHC5003: Error:
runtime error R6002
- floating point not loaded

Can you help me how to solve this? If I run compilation from HTML help workshop it works, but not from commandline... thanks


Finding elements by pattern availability

$
0
0

Following code does not work as expected, i.e. returned element does not implement Dock pattern. Is it FindFirst API limitation or bug?

CoInitializeEx(NULL, COINIT_MULTITHREADED);

CComPtr<IUIAutomation> automation_ptr;
HRESULT hr = automation_ptr.CoCreateInstance(__uuidof(CUIAutomation), NULL, CLSCTX_INPROC_SERVER);

IUIAutomationElement *root_element_ptr;
hr = automation_ptr->GetRootElement(&root_element_ptr);

VARIANT prop;
prop.vt = VT_BOOL;
prop.boolVal = 1;

IUIAutomationCondition* condition_ptr;
hr = automation_ptr->CreatePropertyCondition(UIA_IsDockPatternAvailablePropertyId, prop, &condition_ptr);

IUIAutomationElement* element_ptr = NULL;
hr = root_element_ptr->FindFirst(TreeScope_Descendants, condition_ptr, &element_ptr);

VARIANT check;
hr = element_ptr->GetCurrentPropertyValue(UIA_IsDockPatternAvailablePropertyId, &check);

Injecting Keyboard\Mouse\Touch events - Windows Application vs. Windows Service

$
0
0

I'm trying to implement a C++ Windows 8 application that receives an input from the user (from external device\file\etc..) and simulates keyboard\mouse\touch events. I want the application to run in background and in log-on screen (to simulate Ctrl+Alt+Delete keyboard event for example).

I've been trying to use Windows Service (as it runs in background and in log-on screen as far as I understood), but injecting keyboard events doesn't work. The suggestion of checking-on "Allow service to interact with desktop" in SCM didn't work as well.

My questions are:

  1. Is there anyway to inject keyboard\mouse\touch events in Windows Service? (note: Windows 8, C++ Windows Service)
  2. Is there any other type of Windows application that runs on log-on screen except for Windows Service?
  3. In terms of Arch\Design, what's the best way to implement such an application taking into account that the log-on screen accessibility is optional?

Thanks in advance,

Hani;



Windows Speech Recognition commands

$
0
0

I have implemented the use of the Windows speech recognition in Vista and also with Windows 7 and I've noticed some significant changes that have limited the functionality in Win7.

The user I had set up with speech recognition in Vista was able to use the command "Click" to left-click wherever the mouse pointer happened to be and this no longer works in Windows 7.  The newer interface seems to require a specified location of exactly what to click on i.e. "Click Save" or "Click Close" and the command that's needed is "Click [current mouse location]".

This person works with maps that require a large amount of mouse clicks to draw updated elements of the map.  The "click" command that worked with Vista does not exist in Windows 7 Speech Recognition.

It looks like there may be some hope to create a macro to set this up, but I will need to know how to phrase the commands needed and associated syntax.

Record & Redistribute files generated using Microsoft TTS Voices

$
0
0

Hello,

If an application requires voice prompts / transcripts, Developers have a choice of getting it recorded by a commercial voice-over artist. Obviously, voice artists cost a lot and Developers with non-existent budgets cannot afford them.

An alternate solution would be to use a TTS Voice to generate the WAV files. Unfortunately, most companies like Acapela / Cepstral / Ivona etc. do not allow recorded WAV files (using their TTS voices) to be redistributed unless Developers pay more than it will cost to hire a Voice artist; that too on a recurring yearly basis (royalty).

Microsoft Win8 features some pretty good voices and they can be used too.

Assuming the following scenario:

Task (A): SW Developer to use Microsoft's TTS voices to generate audio, record it as audio data and incorporate  the audio data in the end product.

Task (B): The Audio data will not be accessible away from the product. The online mode of the program will stream the audio data from a web-server while the offline mode of the program will use the audio data from an encrypted storage.

I tried reading up on EULA documents available on this topic, but I was unable to spot any specific license grants or restrictions. I can go with the assumption that I can use the API / Components that came with MS Windows OS and Development tools to develop an application and distribute it; as long as I don't distribute the development tool binaries or other binaries that are restricted for distribution.

We are allowed to freely distribute:

1) Specifically allowed Run-time / SDKs etc. that enable applications to run on the end-user's computer.

2) Any executable program, data (plain text or binary) and supporting files (such as media, databases), that has been generated by the Development tool or generated using a program that was created using the Development tool.

Am I right in my assumption? If someone has studied the SAPI SDK EULA, can they point out any clause that forbid me to perform Task (A) and Task (B)?

TIA

Poor WPF application performance due to UI Automation on certain machines

$
0
0


I am dealing with a performance issue an a WPF application that is related to UI Automation. 

The symptom:
On certain machines, expanding some expanders in our app can hang the app for minutes on end.  On other machines this operation is effectively instantaneous.

Attaching a debugger to the process when it is apparently hung reveals that WPF is executing deep recursive calls to UIElementHelper.InvalidateAutomationAncestors. Poking around in Reflector shows that UIElement.Measure will trigger a call to InvalidateAutomationAncestors if ContextLayoutManager.From(base.Dispatcher).AutomationEvents.Count != 0.  After setting some breakpoints when automation events are added shows that these AutomationEvents are added via the WPF toolip popup plumbing, when there are global Win32 event hooks registered for certain events.

So I guess my question boils down to:

1) Is there a way to protect my application so that UI Automation doesn't destroy its peformance? On the machine I was testing, it turned out that it was Norton Antivirus that had caused the bad interaction, but the number of programs that can trigger this behavior is apparently unbounded.

2) Could it be that we've somehow built our app such that we are triggering degenerate behavior when UIElementHelper.InvalidateAutomationAncestors runs? Any suggestions on how to identify something we may have done wrong?

Login via voice biometrics

$
0
0

I've been looking for documentation on login via voice biometrics. Authentication would preferably happen in the cloud. Before I start digging deep into Windows Credential Provider...does anyone know if this can be done on Windows 8 and if there is any documentation available? Thanks 

Welcome to the Windows Accessibility and Automation Development Forum

$
0
0

Hello all,

 

The scope of the UI Automation forum has expanded to cover all Microsoft accessibility/automation technologies, including UI Automation and Microsoft Active Accessibility. This forum is for discussion of software development, not end-user issues.

 

The typical user of this forum will be:

  • A developer who needs to make a control accessible. 
  • A developer who needs to create an assistive technology such as a screen reader, screen magnifier, on screen keyboard, command & control utility, etc.
  • A developer who wants to create test automation for a GUI. 

When posting issues to the forum please clearly identify the technology you are using, as well as whether you are developing a server/provider component or a client application. 

 

This is a community forum sponsored and moderated by Microsoft, and we hope it provides a place for information to be exchanged. The moderators will also do their best to point you to the information you need, but please keep in mind that we cannot offer support on blocking issues or attempt to resolve bugs.

 

Thanks.

 

 

 

 


 


Windows 8 tranformation pack unique product key

$
0
0
pls send win8TP3 unique porduct key thais email-thanveerbabu@gmail.com, My unique user ID:54214360766451443219031642

Could not Find Automation Element

$
0
0

Hello All,

Iam trying to find  automation element for the particular component in Web apps developed using  ASP.Net .I could not find al the automation elements and Ids .I could see al l the properties using UIA2.0

Please go through the below code. Appreciate your help !

uSECASE 1:

public static void  getRecursiveElements(AutomationElement parent)
{
     
    AutomationElementCollection children,children1,children2;
  children = parent.FindAll(TreeScope.Descendants, Condition.TrueCondition);
  if (children != null && children.Count != 0)
      {
          for (int i = 0; i < children.Count; i++)
          {
              //AutomationElement val = children[i].Current;
              //getRecursiveElements(children[i]);
              sw.WriteLine(children[i].Current.Name);
              sw.WriteLine(children[i].Current.AutomationId);
              sw.WriteLine(children[i].Current.LocalizedControlType);
              //if (children[i].Current.Name == "Create/Edit Asset")
              //{
              children1 = children[i].FindAll(TreeScope.Descendants, Condition.TrueCondition);
              if (children1 != null && children1.Count != 0)
              {
                  for (int j = 0; j < children1.Count; j++)
                  {
                    
                      sw.WriteLine("ChildName1----->" + children1[j].Current.Name);
                      sw.WriteLine("ChildID----->" + children1[j].Current.AutomationId);
                    sw.WriteLine(children1[j].Current.LocalizedControlType);

                      children2 = children1[j].FindAll(TreeScope.Descendants, Condition.TrueCondition);

                     if (children2 != null&&children2.Count!=0)
                      {
                          for (int k = 0; k < children2.Count; k++)
                          {
                              sw.WriteLine("ChildName2----->" + children2[k].Current.Name);
                              sw.WriteLine("ChildID----->" + children2[k].Current.AutomationId);
                             sw.WriteLine(children2[k].Current.LocalizedControlType);
                          }
                      }
                  }
              }
              // }
          }
  }
      sw.Close();
}

useCase 2:

 

 

  private AutomationElement WalkControlElements1(AutomationElement rootElement)
        {
            // Conditions for the basic views of the subtree (content, control, and raw) 
            // are available as fields of TreeWalker, and one of these is used in the 
            // following code.
            AutomationElement elment = rootElement;
            AutomationElement elementNode = null;
            if (elment == null) return elementNode;
          
            // your logic for condition ( this I don’t know what to write)
            //bool val = true;
            elementNode = elment.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.NameProperty, "Select Business Category Product"));

            if (elementNode != null)
            {
                ///val = true;
                return elementNode;
            }
            WalkControlElements1(TreeWalker.ControlViewWalker.GetFirstChild(elment));
            // Call for next sibling
            WalkControlElements1(TreeWalker.ControlViewWalker.GetNextSibling(elment));

            // Call for First child
          
            return elementNode;
        }

 

 

How to automate xap using command line in windows phone 7 and 8 ?

$
0
0
my requirement is i want build xap on replacing one of folder from the resources using command line  that folder should be include resources on xap built.

how to build xap using command line on deleting one of folder and again add that folder to solution?

$
0
0
my requirement is that i want build a xap  if i delete one of folder from resources and after some modification i again add that folder and then build xap using command line.

DataGrid Onclick Event

$
0
0
Hi..I am new to Wpf..and I have been working with DataGrids. I am on a project that needs the rows under the DataGrid to act as ListView and if the user clicks on any row, a new page is to be opened showing the detail view with certain fields. How can this be implemented? kindly reply asap! Thanks! 
Viewing all 585 articles
Browse latest View live


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