在 windows-rs 中使用 IUIAutomationFocusChangedEventHandler 接口
Using IUIAutomationFocusChangedEventHandler interface in windows-rs
我正在尝试使用 IUIAutomation::AddFocusChangedEventHandler 使用官方 windows-rs crate,但为了使用它,我需要实现 IUIAutomationFocusChangedEventHandler 接口,我不知道如何实现生锈
看来我必须定义一个结构并在其上使用实现宏:
#[implement(windows::Win32::UI::Accessibility::IUIAutomationFocusChangedEventHandler)]
struct A{}
但无论我尝试实现什么,我都会得到“IUIAutomationFocusChangedEventHandler 不是 class 或接口”
我好像找到问题出在哪里了
实施宏尚未更新为使用以“windows”而不是“Windows”开头的路径,
所以只需添加
use windows as Windows;
使用以“Windows”开头的路径似乎可以解决问题。
我正在尝试使用 IUIAutomation::AddFocusChangedEventHandler 使用官方 windows-rs crate,但为了使用它,我需要实现 IUIAutomationFocusChangedEventHandler 接口,我不知道如何实现生锈
看来我必须定义一个结构并在其上使用实现宏:
#[implement(windows::Win32::UI::Accessibility::IUIAutomationFocusChangedEventHandler)]
struct A{}
但无论我尝试实现什么,我都会得到“IUIAutomationFocusChangedEventHandler 不是 class 或接口”
我好像找到问题出在哪里了 实施宏尚未更新为使用以“windows”而不是“Windows”开头的路径, 所以只需添加
use windows as Windows;
使用以“Windows”开头的路径似乎可以解决问题。