fix(native): windows 0.61 API paths — repair the CI Windows compile
Build Lotus Chat Desktop / prepare (push) Successful in 5s
Build Lotus Chat Desktop / build-windows (push) Failing after 18m50s
Build Lotus Chat Desktop / build-linux (push) Successful in 23m40s
Build Lotus Chat Desktop / update-manifest (push) Has been skipped

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:
2026-07-01 21:18:25 -04:00
parent 89b82f441d
commit 64569f4736
5 changed files with 22 additions and 14 deletions
+7 -5
View File
@@ -42,16 +42,17 @@ pub fn set_jump_list(app: AppHandle, items: Vec<JumpItem>) -> Result<(), String>
use std::os::windows::ffi::OsStrExt;
use windows::{
core::{w, Interface, HSTRING, PCWSTR, PROPVARIANT},
core::{w, Interface, PCWSTR},
Win32::{
Storage::EnhancedStorage::PKEY_Title,
System::Com::{
CoCreateInstance, CoInitializeEx, CoUninitialize, CLSCTX_INPROC_SERVER,
CoCreateInstance, CoInitializeEx, CoUninitialize, IObjectArray,
IObjectCollection, StructuredStorage::PROPVARIANT, CLSCTX_INPROC_SERVER,
COINIT_APARTMENTTHREADED,
},
UI::Shell::{
DestinationList, EnumerableObjectCollection, ICustomDestinationList,
IObjectArray, IObjectCollection, IShellLinkW, ShellLink,
PropertiesSystem::{IPropertyStore, PKEY_Title},
IShellLinkW, PropertiesSystem::IPropertyStore, ShellLink,
},
},
};
@@ -109,7 +110,8 @@ pub fn set_jump_list(app: AppHandle, items: Vec<JumpItem>) -> Result<(), String>
// The visible label comes from System.Title on the link's
// property store (a bare IShellLink has no display name).
let store: IPropertyStore = link.cast()?;
let title = PROPVARIANT::from(&HSTRING::from(item.title.as_str()));
// From<&str> builds a VT_LPWSTR PROPVARIANT (what System.Title expects).
let title = PROPVARIANT::from(item.title.as_str());
store.SetValue(&PKEY_Title, &title)?;
store.Commit()?;