Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1483

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

$
0
0
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: 201
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: Notifications.zip

Requirements: Windows 10 or later!
Attached Images
 
Attached Files

Viewing all articles
Browse latest Browse all 1483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>