1

I am trying to use the Windows 10 Notification Listener API in a Rust project of mine, and I ran into a mysterious error when trying to register a notification event handler:

listener.NotificationChanged(&TypedEventHandler::new(
  move |_sender, args: &Option<UserNotificationChangedEventArgs>| {
    Ok(())
  },
))?;
Element not found. (0x80070490)

Digging deeper into the docs, I realized this might be a modern API that is only available to applications with identity. So, reasonably, I tried to add package identity to my Rust app, which resulted in a lot more setup. I needed to create a new self-signed certificate, package with MakeAppx.exe, sign with SignTool.exe, and ultimately in the end after all of that it still refuses to install.

install issue

So, my question is primarily: How can I resolve this issue / simplify the development workflow / simplify end user flow? Can I somehow use these APIs in a traditional binary / work around them using a different technique to avoid these requirements? I much preferred the format of a traditional EXE that calls system APIs rather than these "modernized" application systems, as this system introduces a lot of friction in development, for end-users, and for potential future contributors.

I dislike the requirement of needing a certificate for building the app, having to install it first before running, and the inherent complexity of integrating this into a system that does not use traditional windows development tools.

Bluskript
  • 235
  • 1
  • 5
  • 14
  • 2
    Your problems have a priori nothing to do with Rust. Having an app identity (not necessarily a package) is a requirement for using some (not all) newer APIs (~WinRT APIs). You can also have unpackaged app access to API with sparse packages https://blogs.windows.com/windowsdeveloper/2019/10/29/identity-registration-and-activation-of-non-packaged-win32-apps/#oumK0XQ9ISWbBFTA.97 Also note UWP is now legacy https://www.thomasclaudiushuber.com/2021/02/05/what-is-actually-the-universal-windows-platform-and-what-is-winui-msix-and-project-reunion/ – Simon Mourier Dec 27 '22 at 09:21

0 Answers0