question

rohitpatil-7347 avatar image
0 Votes"
rohitpatil-7347 asked Castorix31 commented

Applications crash when automated by a UI Automation client app in Windows

Hello,
Applications crash when automated by a UI Automation client app in Windows
I have developed a Windows UI automation tool using C#. I am automating an external Windows application with this tool. It was working well untill one of the Windows update installed on my machine.

On inserting the older version of DLL in installation directory Appliaction not chrashing.
The version copied to installation directory is: 7.2.17763.1728
DLL: UIAutomationCore.dll

Details:
OS: Windows 10
Build:Version 20H2 (OS Build 19042.1165)
Visual Studio 2015

windows-10-generalwindows-10-application-compatibility
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered rohitpatil-7347 commented

Hello @Rohitpatil-7347,

Thank you for your question.

Sometimes an update can cause a problem, damaging some applications, although this is not something that often happens.

I recommend that you follow the instruction below and check if the problem persists or not:

Instructions: go to settings> update and security> click View update history> at the top of the screen click Uninstall updates> when opening the new screen look for the newly installed update and then right click on it and select Uninstall, wait for the process is complete and then restart your computer to complete the uninstallation completely.

You can also upgrade to version 21H1, which is the latest version of windows 10, I believe this would save potential problems.

To do this you can follow the instruction below:

https://www.microsoft.com/en-us/software-download/windows10

Step 1: Access the above link and select the Update Now option, an application will be downloaded in which you must install on your computer.

Step 2: when installing you must open the application and the download, verification and installation of the recent version will start.

Step 3: After you will be asked to restart the device to complete the update, after a few minutes you will have the latest version.



If the answer is helpful, please vote positively and accept as an answer.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello
I update my system but still problem not solve

0 Votes 0 ·
Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 commented

Have you tested if the sample application I posted in your other same thread crashes too ?
8 days ago and no feedback...





· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello,
thank you for your answer.
due to the update now my application throws multiple exceptions before it is only one.
so how many time i have to change my code.
I am searching for a generic solution.
now I am trying to update my windows.
if you have something like this please share

0 Votes 0 ·

But does the sample I posted crash ?
(it works fine on my OS)

0 Votes 0 ·
                      AutomationElement element = AutomationElement.FromPoint(new System.Windows.Point(Cursor.Position.X, Cursor.Position.Y));

                     if (element != null && !element.Equals(capturedElement))
                     {
                         GDI32.RedrawWindow(capturedElement);
                         GDI32.HighlightWindow(element);
                         capturedElement = element;
                     }

Here if I change the AutomationElement to CUIAutomation() then I am not able to pass the element to GDI32.HighlightWindow(element); because of cast issue
can you have a solution for this?

                      IUIAutomation uiA = null;
                     System.Drawing.Point point = new System.Drawing.Point(Cursor.Position.X, Cursor.Position.Y);
                     tagPOINT tp = new tagPOINT();
                     tp.x = (int)point.X;
                     tp.y = (int)point.Y;
                     IUIAutomationElement element = uiA.ElementFromPoint(tp);

                     if (element != null && !element.Equals(capturedElement))
                     {
                         GDI32.RedrawWindow(capturedElement);
                         GDI32.HighlightWindow(element);
                         capturedElement = element;
                     }

this is changed code






0 Votes 0 ·
Show more comments