Oboba 5 Posted September 25 The changelog for the new Delphi version says: "VCL includes, for the first time, an integration of the UIAutomation Microsoft interfaces, which can be used to support accessibility and to build automatic UI testing." - but there seems to be no real examples of how to use it or any ready support in the existing controls. Seems that there added TUIAutomationCustomControlProvider class and headers from Winapi. How can this be used to improve accessibility of a program created in Delphi? 2 Share this post Link to post
zed 17 Posted September 25 (edited) I have another question: is it possible to disable this new feature altogether to get rid of the new dependency on uiautomationcore.dll, which prevents .exe files from running on older versions of Windows, like XP and 2000? Edited September 25 by zed Share this post Link to post
shineworld 89 Posted September 25 Could UIAutomation increase the possibility of malicious software interfacing more easily with an application to cause problems? Share this post Link to post
DelphiUdIT 266 Posted September 25 25 minutes ago, shineworld said: Could UIAutomation increase the possibility of malicious software interfacing more easily with an application to cause problems? I don't thnk so, at least until you create a provider. For now, Delphi creates applications with a nil UIA provider (I tested some applications of mine), I don't think there are any problems. But if you manually create a provider, it's configured on the server, and it's possible that you can interact with it from the outside. I don't know to what extent. I think we should wait until more explanation will come from Embarcadero or from other experts. Share this post Link to post
pyscripter 849 Posted September 25 (edited) 7 minutes ago, DelphiUdIT said: For now, Delphi creates applications with a nil UIA provider (I tested some applications of mine), I don't think there are any problems. Indeed. At the moment all we got is some scaffolding. Had Embarcadero declared the UIAutomation functions as delayed no dll would be loaded. Maybe you could submit an issue to that effect. But you could try to do that with your project. Edit Winapi.UIAutomation to add the delayed attribute and include it in your project (not tested). Edited September 25 by pyscripter 1 Share this post Link to post
DelphiUdIT 266 Posted September 25 20 minutes ago, pyscripter said: Indeed. At the moment all we got is some scaffolding. Had Embarcadero declared the UIAutomation functions as delayed no dll would be loaded. Maybe you could submit an issue to that effect. But you could try to do that with your project. Edit Winapi.UIAutomation to add the delayed attribute and include it in your project (not tested). It works. Adding the delayed attribute prevents the DLL from loading. By now, since in the future EMB can always call it to initialize something .... Share this post Link to post
Patrick PREMARTIN 167 Posted September 25 1 hour ago, zed said: I have another question: is it possible to disable this new feature altogether to get rid of the new dependency on uiautomationcore.dll, which prevents .exe files from running on older versions of Windows, like XP and 2000? Except compiling in a previous Delphi release, I don't think it's possible. The supported Windows target are : Windows 11 Windows 10 Windows Server 2025 Windows Server 2022 Delphi XE5 is the latest platform officially compatible with Windows XP. https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page 1 Share this post Link to post
pyscripter 849 Posted September 25 2 hours ago, Oboba said: How can this be used to improve accessibility of a program created in Delphi? Have a look at SynEdit/Source/SynAccessibility.pas at master · pyscripter/SynEdit to see how UI.Automation can be used for accessibility support. SynEdit was one of the first Delphi controls to support UI Automation for this purpose. 1 1 Share this post Link to post
Remy Lebeau 1674 Posted September 25 (edited) 5 hours ago, Patrick PREMARTIN said: Except compiling in a previous Delphi release, I don't think it's possible. It is possible with some additional tweaking. You can go into the compiler's linker options and set the PE header OS Version and SubSystem Version fields to 5.0 for Win2K or 5.1 for XP. Also, if you use the System.Threading unit then make a copy of it, modify it to call GetTickCount() instead of GetTickCount64() on pre-Vista systems, and then add the copy to your project. Edited September 25 by Remy Lebeau 3 Share this post Link to post
Oboba 5 Posted September 25 9 hours ago, zed said: I have another question: is it possible to disable this new feature altogether to get rid of the new dependency on uiautomationcore.dll, which prevents .exe files from running on older versions of Windows, like XP and 2000? I don't think so, unless you want to modify RTL sources. Vcl.Controls uses WinApi.UIAutomation unit which has static imports from UIAutomationCore.dll. 8 hours ago, pyscripter said: Have a look at SynEdit/Source/SynAccessibility.pas at master · pyscripter/SynEdit to see how UI.Automation can be used for accessibility support. SynEdit was one of the first Delphi controls to support UI Automation for this purpose. Thank you, will have a look at it. Share this post Link to post
Vandrovnik 225 Posted September 26 (edited) 11 hours ago, Oboba said: I don't think so, unless you want to modify RTL sources. Vcl.Controls uses WinApi.UIAutomation unit which has static imports from UIAutomationCore.dll. Thank you, will have a look at it. Hmm, as a last resort solution, you could create a fake UIAutomationCore.dll for Windows 2000 computers and save it to your application's folder... Edited September 26 by Vandrovnik Share this post Link to post
DelphiUdIT 266 Posted September 26 7 hours ago, Vandrovnik said: Hmm, as a last resort solution, you could create a fake UIAutomationCore.dll for Windows 2000 computers and save it to your application's folder... Like I wrote (suggestion from @pyscripter) simply add 'delayed' in the UIAuotmation unit. Share this post Link to post
Oboba 5 Posted September 27 (edited) This new Winapi.UIAutomation unit has IAccesible declared, in addition, it has always been declared in Winapi.oleacc unit. And those declarations are different, e.g., the Get_accName method: // oleacc function Get_accName(varChild: OleVariant; out pszName: WideString): HResult; stdcall; //UIAutomation function get_accName(varChild: OleVariant; out pszName: PChar): HRESULT; stdcall; - if UIAutomation unit is used in the existing unit where a class implements IAccessible, it no longer compiles. Also ISelectionProvider seems to be off, its GetSelection is declared like this function GetSelection(out pRetVal: SAFEARRAY): HRESULT; stdcall; while it should be function GetSelection(out pRetVal: PSAFEARRAY): HRESULT; stdcall; to match the WinApi declaration. And it does throw Access Violation if the Delphi's ISelectionProvider declaration is used. It's either I'm totally wrong about something, or UIAutomation unit needs some more work. Edited September 27 by Oboba Share this post Link to post
Oboba 5 Posted September 27 (edited) duplicate Edited September 27 by Oboba Share this post Link to post
Oboba 5 Posted September 27 This new Winapi.UIAutomation unit has IAccesible declared, in addition, it has always been declared in Winapi.oleacc unit. And those declarations are different, e.g., the Get_accName method: // oleacc function Get_accName(varChild: OleVariant; out pszName: WideString): HResult; stdcall; //UIAutomation function get_accName(varChild: OleVariant; out pszName: PChar): HRESULT; stdcall; - if UIAutomation unit is used in the existing unit where a class implements IAccessible, it no longer compiles. Also ISelectionProvider seems to be off, it GetSelection is declared like this function GetSelection(out pRetVal: SAFEARRAY): HRESULT; stdcall; while it should be function GetSelection(out pRetVal: PSAFEARRAY): HRESULT; stdcall; to match the WinApi declaration. And it does throw Access Violation if the Delphi's ISelectionProvider declaration is used. It's either I'm totally wrong about something, or UIAutomation unit needs some more work Share this post Link to post
pyscripter 849 Posted September 27 38 minutes ago, Oboba said: Also ISelectionProvider seems to be off, it GetSelection is declared like this Indeed. See also my own translation: https://github.com/pyscripter/SynEdit/blob/27b5d713b4806ccbf38412cd138d8ee7d4ccc499/Source/SynAccessibility.pas#L220 The weird thing is that GetIt includes the "Windows API from WinMD" package that has correct translations of the Automation API and many others. Why Embarcadero did not use these translations escapes me. Please submit a bug report. 3 Share this post Link to post
Remy Lebeau 1674 Posted September 27 1 hour ago, Oboba said: This new Winapi.UIAutomation unit has IAccesible declared, in addition, it has always been declared in Winapi.oleacc unit. And those declarations are different, e.g., the Get_accName method Hmm, I don't think they should have re-declared IAccessible. They should have had Winapi.UIAutomation use Winapi.oleacc instead. Even the SDK uiautomationcore.h header doesn't redeclare IAccessible. The new IAccessibleEx inherits from the IAccessible in oleacc.h. 1 hour ago, Oboba said: Also ISelectionProvider seems to be off, it GetSelection is declared like this function GetSelection(out pRetVal: SAFEARRAY): HRESULT; stdcall; while it should be function GetSelection(out pRetVal: PSAFEARRAY): HRESULT; stdcall; to match the WinApi declaration. Agreed. 1 hour ago, Oboba said: It's either I'm totally wrong about something, or UIAutomation unit needs some more work I would say it needs more work. 1 Share this post Link to post
A.M. Hoornweg 161 Posted September 29 About UIAutomationCore.dll, ChatGPT says the following: "Windows XP and earlier versions do not include this file by default. They relied mainly on MSAA. However, UIAutomation could be installed on Windows XP by installing the .NET Framework 3.0/3.5 (which backported parts of the API and the DLL)". Share this post Link to post
Oboba 5 Posted Tuesday at 08:07 PM On 9/28/2025 at 1:08 AM, pyscripter said: Please submit a bug report. I did. On 9/28/2025 at 2:17 AM, Remy Lebeau said: I don't think they should have re-declared IAccessible. They should have had Winapi.UIAutomation use Winapi.oleacc instead. I also think so, is there any adequate reason why they didn't do so? Share this post Link to post
Tommi Prami 159 Posted Friday at 07:43 AM Hello, Has someone made tickets for Emba of these issues in this discussion. If/will so so, links please. -tee- Share this post Link to post
Zoë Peterson 16 Posted Friday at 01:10 PM 5 hours ago, Tommi Prami said: Has someone made tickets for Emba of these issues in this discussion. If/will so so, links please. https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-4278 1 Share this post Link to post
MarkShark 27 Posted Saturday at 11:28 AM I must admit that I miss the old "voting on bugs" feature of the bug portal. At least it felt like I had some kind of voice (even if it wasn't exactly a roar lol.) Is there a bug report or feature request to add "delayed"? Would it make sense to add the "delayed" request as a bug report, a feature request, or just as a comment on one of the other UIAutomation entries? Share this post Link to post