Results 1 to 28 of 28

Thread: VB6 - Simple ToastNotification with Interactive Elements (using WinRT XML interfaces)

Threaded View

  1. #1

    Thread Starter
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,644

    Thumbs up VB6 - Simple ToastNotification with Interactive Elements (using WinRT XML interfaces)

    From the "How to interactively annoy your users" series, here's a VB6 project showcasing ToastNotifications (which were later insipidly renamed to "App Notifications") including some interactive elements (TextBox, ComboBox and Buttons) that the users can play with and respond to your notification.

    A TypeLib with the required WinRT interface definitions is included in the ZIP archive, don't forget to set a reference to it.

    These ToastNotifications use an XML format which adheres to some rather strict standards but is nevertheless quite customizable. You could provide the whole XML code from the beginning but this project shows how you can start with a built-in already provided template and add your own flavors to it. The base template used here included just a text-only notification with a bold title and two lines of text. Building on top of it, I added a banner-style image at the top (so-called "hero" image), a small "Logo" image, a TextBox to write something back, a ComboBox to select a fictive rating and two action buttons at the bottom.

    This is how it looks in the Action Center:

    Name:  ToastNotificationActionCenter.png
Views: 2911
Size:  318.8 KB

    The notification sends events back to your app communicating whatever happened to it (like being dismissed or users interacting with it in some way). While it is possible to receive these events in "offline" mode (like when users interact with the notification in the Action Center long after your app had been closed), this project demonstrates only real-time events and removes the notification from the Action Center after being dismissed.

    Here is the demo project: ToastNotifications.zip (Updated to include image downloading)

    Requirements: Windows 10 or later!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width