Add Win8+ toast notification to wxNotificationMessage.
Since Windows 8 there are native toast notifications available via WinRT defined in windows.ui.notifications.h. This adds support for these notifications via wxNotificationMessage. These notifications have to be explicitly enabled via wxNotificationMessage::MSWEnableToasts() because they require a start menu shortcut to the application.
This commit is contained in:
@@ -2289,6 +2289,14 @@ private:
|
||||
|
||||
void MyFrame::OnNotifMsg(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
// Try to enable toast notifications (available since Win8)
|
||||
if ( !wxNotificationMessage::MSWUseToasts() )
|
||||
{
|
||||
wxLogDebug("Toast notifications not available.");
|
||||
}
|
||||
#endif
|
||||
|
||||
TestNotificationMessageWindow* dlg = new TestNotificationMessageWindow(this);
|
||||
dlg->Show();
|
||||
}
|
||||
|
Reference in New Issue
Block a user