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

AutomationElement.FromPoint method retrieves wrong AutomationElement in some cases

$
0
0

I am working on an application where I need to know if the mouse cursor is over the maximize button. When I use AutomationElement.FromPoint method to retrieve the AutomationElement, I retrieve the wrong element in some cases.

I wrote a simple console application based on the MSDN example code:

while(true)
  {
  System.Windows.Point point = new System.Windows.Point(Cursor.Position.X, Cursor.Position.Y);

  AutomationElement element = AutomationElement.FromPoint(point);

  if(element != null)
  {
    Console.WriteLine("Element at position " + point + " is '" + element.Current.Name + "'");  }  Thread.Sleep(1000);
}

The problem I encounter is that I retrieve the minimize button AutomationElement when the mouse pointer is over the first third part of the maximize button of Notepad on Windows 10. When the mouse pointer is over the first third part of the close button the retrieved element is the maximize button. Running Windows 8.1 I get similar behaviour on the close button of Notepad.

I would like to know what is going wrong in my approach.

Thanks,

Sander

UI Automation Client-Side IRawElementProviderSimple implementation - expose children of custom control

$
0
0

I have a executable of an WPF application with custom controls which i need to run UI Tests on with Coded UI.

The custom controls do not implement accessibility / automation peers etc. The app consists of a custom UserControl with a canvas inside, where mouse button clicks add ellipse shapes to the canvas. (I know this because i have the source code - but i need to implement client-side UIA support)

How can i implement a GetChildren method (as in the equivalent to FrameworkElementAutomationPeer.GetChildrenCore on server-side support) that will expose the control's (ellipse collection) children to be seen in the Coded UI Test Builder ?

Is it possible to view the control's children in a tool like UIspy or Inspect.exe ?

Following the steps in https://msdn.microsoft.com/en-us/library/ms754059(v=vs.110).aspx, I tried implementing a Provider class which implements IRawElementProviderSimple but was unable to understand how to provide accessibility to the custom controls.

Custom UI Automation Providers

$
0
0

I was looking for clear samples on writing Custom UI Providers and found great post at Microsoft Window UI Automation Blog but the code links at the posts from Michael Bernstein does not work anymore. Wonder if someone knows where to get this sample code. It seem they contain what i need to know. 

Part 1: http://blogs.msdn.com/b/winuiautomation/archive/2010/05/11/custom-ui-automation-providers-in-depth-part-1.aspx

Part 2: http://blogs.msdn.com/b/winuiautomation/archive/2010/05/12/custom-ui-automation-providers-in-depth-part-2.aspx

Part 3: http://blogs.msdn.com/b/winuiautomation/archive/2010/05/12/custom-ui-automation-providers-in-depth-part-3.aspx

Part 4: http://blogs.msdn.com/b/winuiautomation/archive/2014/06/13/10020345.aspx

Part 5: http://blogs.msdn.com/b/winuiautomation/archive/2010/05/11/custom-ui-automation-providers-in-depth-part-5.aspx

Part 6: http://blogs.msdn.com/b/winuiautomation/archive/2010/07/28/custom-ui-automation-providers-in-depth-part-6.aspx

Looking for a C# samples.

Thanks for any help.


Diabling the Start button and taskbar

$
0
0

I’m looking for a way to remove the taskbar and start button in Windows 7.  I need to prevent users from having access to the system as much as possible.  I removed all hot keys and shortcuts and removed all CTRL-ALT-DELETE options through the registry and policies.  (If you know of a way to completely prevent CTRL-ALT-DELETE from doing anything, let me know).  I also remapped the ESC key to prevent some access.

The one thing I can’t do is remove the start button and taskbar.  Any and all help is greatly appreciated.

UI Automation Client-Side Provider for Windows Forms Custom Control using C#

$
0
0

Hi Folks - I been looking for information on client-side providers using C# for Window Forms Custom Controls so i can get information of inner elements at this control. I have been able to make to work some simple samples but not sure how i can get inner information from that custom control. The control does its rendering by customized draws of text and rectangles and other kinds of elements by using the overrided OnPaint method and here is where im not sure how to proceed. Unfortunatelly i do not have code of that custom control so the only way to approach this as I understand is by using Client-Side Providers where there Server-Side Providers is for controls were code is available which is not my case.

Wonder if some one can light me how to do this using C# language.

Here is a simple custom control wich draws a simple text, the objective is to get the value of that text element.

public partial class CompositeCustomControl : Control
    {
        public CompositeCustomControl()
        {
            InitializeComponent();
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            Font drawFont = new Font("Arial", 20);

            SolidBrush drawBrush = new SolidBrush(Color.Black);
            Pen blackPen = new Pen(Color.Black);

            float x = 5.0F;
            float y = 5.0F;
            float width = 200.0F;
            float height = 50.0F;
            RectangleF drawRect = new RectangleF(x, y, width, height);

            pe.Graphics.DrawRectangle(blackPen, x, y, width, height);

            StringFormat drawStringFormat = new StringFormat();
            drawStringFormat.Alignment = StringAlignment.Center;

            pe.Graphics.DrawString("Sample string", drawFont, drawBrush, drawRect, drawStringFormat);
        }
    }
Thanks in advance for any help.


How to return the custom properties for my custom controls in UI Automation(Coded UI)?

$
0
0

Hi Team,

I have successfully implemented the Coded UI support for my WinForms Custom control. Now i am trying to implement the Coded UI support as in built one (without Extensions and property provider). I have implemented this way also. But i don't know how to return my custom properties. For more information, please refer this link: https://msdn.microsoft.com/en-us/library/ms747208%28v=vs.110%29.aspx

Please help me on this.

Regards,

Neelakandan




How to display the custom properties for ControlType.Custom controls?

$
0
0

Hi Team,

I have referred the following blog for returning the custom control type for my control. But i don't know how to display the custom properties for my control?

http://blogs.msdn.com/b/winuiautomation/archive/2010/06/05/custom-ui-automation-providers-in-depth-part-3.aspx?CommentPosted=true#commentmessage

Can you please let me know how to display my control's properties?

Regards,

Neelakandan


Regards, Neelakandan

Windows phone app, how to use narrator read page title automatically?

$
0
0

I'm developing windows universal app(XAML,C#) on phone, and am enabling accessibility for Narrator. Does anybody know how to get narrator automatically to read page title when a page is opened?

I tried setting automationproperties.name in page but didn't work:

<Page
x:Class="xxxxxx"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
AutomationProperties.Name="Page title to be read"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">


How Port scanner software woks ?

$
0
0

How port scanner Software works ? 

Thanks. 

UIAutomation Fails for NVIDIA Control Panel - Set up multiple displays

$
0
0

I have a latest NVIDIA driver (Ver 8.1.870.0) installed on my Windows 10 machine.

Was try using Inspect and UIAVerify (Win10 SDK) apps to check the Automation elements with respect to NVIDIA - Setup Multiple Displays section.

Laptop + one External Monitor:

- I didn't see any Inspect and UIAVerify crash. Both were working as expected

Laptop + 2 External Monitor:

- Inspect and UIAVerify both have got crashed.

Can anyone help us out, is this a UIAutomation issue? or anything to do with NVidia driver.

Thanks in advance for your help


Inspect Object app crashes on Win10 (and Win8)

$
0
0

I am trying to use the Inspect Object app (inspect.exe) that comes with the WinSDK to look at the MSAA hierarchy of my app, but it almost always crashes. I get the "Inspect Object (64-bit UNICODE Release) has stopped working" dialog up, frequently right after launching the app, sometimes after I browse around the left-hand tree view a bit. I have also tried the 32-bit release, as well as the versions from the Win8 SDK when I was still working on Windows 8. This app rarely works.

Is there a known conflict with some other app? A system or registry setting that causes problems with Inspect?

When I attach a debugger to Inspect Object, I get the following info:

Unhandled exception at 0x00007FFD7407E00C (ntdll.dll) in inspect.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFD740D22B0).

>    ntdll.dll!RtlReportCriticalFailure()    Unknown
     ntdll.dll!RtlpHeapHandleError()    Unknown
     ntdll.dll!RtlpLogHeapFailure()    Unknown
     ntdll.dll!RtlFreeHeap()    Unknown
     oleaut32.dll!APP_DATA::FreeCachedMem(void *,unsigned long)    Unknown
     oleaut32.dll!SysFreeString()    Unknown
     inspect.exe!AUI_PropertyValueToString(struct PropertyValue *,int (*)(struct PropertyValue *,unsigned short * *),struct EnumInfo *,unsigned short * *)    Unknown
     inspect.exe!ObjectManager::GetElementInfo(unsigned int,int *,int *,int,unsigned short * *,unsigned short * *,struct tagRECT *,int *,unsigned short * * *,unsigned int *)    Unknown
     inspect.exe!DisplayObjectProperties(unsigned short const *,struct HWND__ *,int)    Unknown
     inspect.exe!DisplayTreeSelected(void)    Unknown
     inspect.exe!MainWindowProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)    Unknown
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!SendMessageWorker()    Unknown
     user32.dll!SendMessageW()    Unknown
     inspect.exe!UITreeView_HandleNotify(struct HWND__ *,unsigned __int64,__int64,__int64 *)    Unknown
     inspect.exe!MainWindowProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)    Unknown
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!SendMessageWorker()    Unknown
     user32.dll!SendMessageW()    Unknown
     comctl32.dll!CCSendNotify()    Unknown
     comctl32.dll!TV_SendSelChange(struct _TREE *,int,struct _TREEITEM *,struct _TREEITEM *,unsigned int)    Unknown
     comctl32.dll!TV_SelectItem(struct _TREE *,unsigned __int64,struct _TREEITEM *,unsigned int,unsigned int)    Unknown
     comctl32.dll!TV_WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)    Unknown
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!CallWindowProcW()    Unknown
     inspect.exe!UITreeViewWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)    Unknown
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!DispatchClientMessage()    Unknown
     user32.dll!__fnDWORD()    Unknown
     ntdll.dll!KiUserCallbackDispatcherContinue()    Unknown
     user32.dll!NtUserSetFocus()    Unknown
     comctl32.dll!TV_ButtonDown(struct _TREE *,unsigned int,unsigned int,int,int,unsigned int)    Unknown
     comctl32.dll!`DuiTelemetry::Instance(void)'::`2'::`dynamic atexit destructor for 'wrapper''(void)    Unknown
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!CallWindowProcW()    Unknown
     inspect.exe!UITreeViewWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)    Unknown
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!DispatchMessageWorker()    Unknown
     inspect.exe!WinMain()    Unknown
     inspect.exe!WinMainCRTStartup()    Unknown
     kernel32.dll!BaseThreadInitThunk()    Unknown
     ntdll.dll!RtlUserThreadStart()    Unknown

wimdows 8 unique product key

$
0
0

please send a windows 8 unique product key my email is ; lourencosithorfabiao@hotmail.com

my umique ID is...542160698084846021623554

How can I know whether process/thread is free or not

$
0
0

Hi Everyone,

I am automating my .net application using AutomationElement I want to write process synchronization. Is there any .Net API which can tell us whether process free or not?

Regards,

Rajendar.

C++/CLI MSAA Automation get_accChildCount returns 21 when /clr (managed) is specified and 0 when it is not (unmanaged)

$
0
0

I have been using MSAA through C++/CLI to interact with a windows forms UI component (it is an Infragistics UltraWinTree). The code to do so is very straightforward:

IAccessible* accessibleObj;
AccessibleObjectFromWindow(hwnd, OBJID_CLIENT,     IID_IAccessible, (void**)&accessibleObj);
long childCount;
accessibleObj->get_accChildCount(&childCount);

The extremely odd issue with this code is that if I compile the code with /clr to create a managed executable childCount is 21 (the correct answer) while on the other hand if there is no /clr specified the unmanaged executable has childCount as 0 (incorrect). It is extremely odd that this would be happening, especially since the managed version just makes an unmanaged call to AccessibleObjectFromWindow anyway.

From debugging I found that although the HRESULT from AccessibleObjectFromWindow is S_OK in both cases in the failing case GetLastError returns 2 (which for general system errors is "File Not Found") while for the working version it returns 0. Also I tried sending WM_GetObject directly to the Hwnd and found that it returned a non-zero value in both cases. Lastly I compared a procmon registry and file system capture for both cases and found that the failing case only checks the registry key for IAccessible while the succeeding case does tons more stuff checking lots of other registry keys (not sure why).

So I am not sure if this is due to a security issue or a difference in how the managed vs unmanaged version located files, but any way that I can look at it now it seems like it has something to do with finer details of MSAA that I am not aware of. Any help will be greatly appreciated :).


Helping the deaf and blind

$
0
0
You might already have an app that dose this. We must dream to create reality, I thought artificial intel could help the deaf and blind so they could communicate and see. We could use voice to text so if a person talked into a phone it would write down in text so the deaf could read what a person is saying for one and then I thought we could make a pair of glasses with video lens for the blind to tell them what is in front of them with a blue tooth ear peace you might have these already would be fun to work on inventions like these to help the less fortunate. Could you think of a deaf person with a phone on speaker talk to text and have a screen built in to a pair of glasses to read out what a person is saying with out having to read lips or sign language, they could communicate with ease the blind could walk around a room with ease some day science will be able to connect video through artificial intel to make a blind person see.

Build exe to run a cmd script

$
0
0

Hello guys

I hope this is the right forum section to post this in, if not please move or tell me

I want to make a exe single clickable exe to do run a script to install software, install a printer and start the software

the script involves copying a folder of the software into the machines program files, then install the shared network printer, then start the printer software

here is my script which Ive tested it it works perfectly:

xcopy /e /c /k /y /R "c:\temp\PaperCut Installer\*.*" "C:\Program Files (x86)\PaperCut Installer\"

msiexec /i "C:\temp\PaperCut Installer\pc-client-admin-deploy.msi" /qn

rundll32 printui.dll,PrintUIEntry /in /n\\PrintServer\LunchRoomPrinter

"c:\Program Files (x86)\PaperCut MF Client\pc-client.exe"

The guides I looked up already provide some info but not really anything for scripts which involves copying a folder then installing a printer and starting the installed program

could anyone provide any useful tips please

How to pass the object in AutomationPeer in codedUi?

$
0
0
I have passed the string builder in Automation peer but i need to pass the object. Is it possible?

Please refer my below code for passing the string, i have override the GetItemStatusCore from FrameworkElementAutomationPeer

              protected override string GetItemStatusCore()
        {
            if (this.Owner is VirtualizingCellsControl)
            {
                var virtualizingCellsControl = this.Owner as VirtualizingCellsControl;
                StringBuilder gridrowItems = new StringBuilder();
                var dd = virtualizingCellsControl.DataContext;
                var fontFamily = virtualizingCellsControl.FontFamily;
                var fontSize = virtualizingCellsControl.FontSize;
                gridrowItems.Append(string.Format("{0}#", fontFamily));
                gridrowItems.Append(string.Format("{0}#", fontSize));
                return gridrowItems.ToString();
            }
            return null;
        }

Why would PhysicalToLogicalPointForPerMonitorDPI fail?

$
0
0

Hi -- I'm trying to use LogicalToPhysicalPointForPerMonitorDPI and PhysicalToLogicalPointForPerMonitorDPI to get other applications' views of the sizes of their windows, regardless of whether my app is running in High DPI mode or not.

So my app creates a full-monitor hidden window; then calls GetWindowRect on the target window; calls LogicalToPhysicalPointForPerMonitorDPI on the corners of that rectangle using my hidden window; and calls PhysicalToLogicalPointForPerMonitorDPI again on the corners using the target window.

The logical-to-physical call, and everything before it, works, but the physical-to-logical call fails. Why would this fail?

The documentation for these functions doesn't give any reasons why the calls would fail.

is it possible to have different theme on different windows 10 desktop?

$
0
0

One of my favorite tools, process explorer does not show very well under Windows 10 High Contrast theme.

As I am working with a laptop and an extend monitor, is it possible to have two desktop with different theme. So that I can keep one theme in high contrast and another in normal, as I think there will always be application that does not display so well in high contrast mode and high contrast mode will help to protect my eyes.

Powershell scripting the Windows 10 Export-StartLayout during logoff to effectively roam the StartLayout between computers

$
0
0

Originally posted here: 

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/6ab0e83d-2d52-4e96-a9d3-68c9300f4e04/powershell-scripting-the-exportstartlayout-during-logoff-to-effectively-roam-the-startlayout?forum=ITCG

Can anyone tell me how to make it work during logoff? Maybe there is a way to tell my powershell script to log back in as a console only app to run export-layout and then log back out? Maybe a way to get the application that serves the .Net calss to work during logoff?

I halve already tried:

  • Using GPO to prevent the registry from detaching during initial logoff

Computer Configuration->Administrative Templates->System-> UserProfiles 

Do not forcefully unload the user registry at user logoff

https://blogs.msdn.microsoft.com/distributedservices/2009/11/06/a-com-application-may-stop-working-on-windows-server-2008-when-the-identity-user-logs-off/

  • Using regasm to make sure the .Net GAC StartLayout dll is registered

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Windows.StartLayout.Commands\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.Windows.StartLayout.Commands.dll /tlb
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Windows.StartLayout.Commands.Resources\v4.0_10.0.0.0_en_31bf3856ad364e35\Microsoft.Windows.StartLayout.Commands.Resources.dll /tlb
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Windows.StartLayout.Commands\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.Windows.StartLayout.Commands.dll /tlb
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Windows.StartLayout.Commands.Resources\v4.0_10.0.0.0_en_31bf3856ad364e35\Microsoft.Windows.StartLayout.Commands.Resources.dll /tlb

  • Tried changing the permissions on the RuntimeBroker

https://blogs.msdn.microsoft.com/emeadaxsupport/2010/01/26/unable-to-edit-the-dcom-settings-for-iis-wamreg-admin-service-on-a-windows-server-2008-r2-when-trying-to-configure-kerberos-authentication-for-role-centers/ :
Changed owner to local admins on HKEY_CLASSES_ROOT\AppID\{9CA88EE3-ACB7-47c8-AFC4-AB702511C276} and added full control for local admins
Using Component Services\DCOM Config\RuntimeBroker added allow all for everyone and identity "the launching user".


Here is the error:

Export-StartLayout : Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
At C:\Windows\System32\GroupPolicy\RoamStartTiles.ps1:52 char:1+ Export-StartLayout -Path $RoamStartTilesXMLPath+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [Export-StartLayout], COMException+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.Windows.StartLayout.Commands.Exp
   ortStartLayoutCommand

Viewing all 585 articles
Browse latest View live


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