fix(native): windows 0.61 API paths — repair the CI Windows compile
Four unresolved-import/type errors from the release build (first real compile): - toast.rs: generic IMap moved to the windows-collections crate; read the reply from the ValueSet returned by UserInput() directly (HasKey/Lookup are exposed on the class). - jumplist.rs: PROPVARIANT lives in Win32::System::Com::StructuredStorage (not windows::core); IObjectArray/IObjectCollection in Win32::System::Com (not UI::Shell); PKEY_Title in Win32::Storage::EnhancedStorage (feature added); build the title PROPVARIANT via From<&str> (VT_LPWSTR). - smtc.rs: event registrations return a plain i64 token in windows 0.61 (the EventRegistrationToken newtype is gone). - thumbbar.rs: HICON was imported inside the fn body but used in its signature — fully qualify the return type. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -222,13 +222,14 @@ fn show_windows_toast(
|
||||
fn read_reply(
|
||||
args: &windows::UI::Notifications::ToastActivatedEventArgs,
|
||||
) -> Option<String> {
|
||||
use windows::core::{HSTRING, IInspectable, Interface};
|
||||
use windows::Foundation::Collections::IMap;
|
||||
use windows::core::{HSTRING, Interface};
|
||||
use windows::Foundation::IReference;
|
||||
|
||||
// UserInput() is an IPropertySet (IMap<String, Object>); the text input value
|
||||
// is boxed as an IReference<HSTRING>.
|
||||
let inputs: IMap<HSTRING, IInspectable> = args.UserInput().ok()?.cast().ok()?;
|
||||
// UserInput() returns a ValueSet; windows 0.61 exposes its IMap methods
|
||||
// (HasKey/Lookup) directly on the class (the generic IMap interface itself
|
||||
// moved to the separate windows-collections crate). The text input value is
|
||||
// boxed as an IReference<HSTRING>.
|
||||
let inputs = args.UserInput().ok()?;
|
||||
let key = HSTRING::from("reply");
|
||||
if !inputs.HasKey(&key).ok()? {
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user