Home > database >  Using IUIAutomationFocusChangedEventHandler interface in windows-rs
Using IUIAutomationFocusChangedEventHandler interface in windows-rs

Time:11-16

I am trying to use IUIAutomation::AddFocusChangedEventHandler using the official windows-rs crate, but in order to use it I need to implement the IUIAutomationFocusChangedEventHandler interface, which I am at a lose on how to do in rust

It seems that I have to define a struct and use the implement macro on it:

#[implement(windows::Win32::UI::Accessibility::IUIAutomationFocusChangedEventHandler)]
struct A{}

But no matter what I try to implement I get "IUIAutomationFocusChangedEventHandler is not a class or interface"

CodePudding user response:

I seem to have found where the problem is The implement macro has not been updated to use paths starting with "windows" instead of "Windows", so just adding

use windows as Windows;

and using paths starting with "Windows" seems to fix the problem.

  • Related