Guidelines to display toast notifications
-
2011年10月7日 15:18I was wondering how 'Windows Defender' or 'Windows Firewall' handles this situation when a critical toast needing immediate user attention is required.
In the documentation of MSDN (for toasts) it was mentioned that toasts should not be used to display critical alerts that need immediate user attention. In this case, the information should be displayed in the app or the tile. But the app may be suspended and the tile may not be visible to the user so toast is the only choice.
全部回复
-
2011年10月7日 18:31版主
A toast by definition is a message that is displayed briefly and then goes away on its own. It the app is suspended, it will not be sending toasts anyhow. If you have an app that is a critical app like defender, they you should design this as a Desktop app and not a Metro Style app. It can then send messages via the tray notification.
Jeff Sanders (MSFT) -
2011年10月7日 18:43
There can be a background task that shows toasts no? Is the toast clickable (and the app showing showing the toast gets click notification)? Or the sole purpose of the toast is to show a notification and the user is responsible for opening the app.
Just writing a desktop app doesnt solve the problem unfortunately. If 'Windows Firewall' or Defender wants the user to take an action on something it has detected (like a malware\trojan) and if the user is on Metro UI, how is the messaging going to work? Without a toast, the user will have no idea that a user action is needed for Defender\Firewall to act upon a malware detection. And if user spends all his\her time on Metro, such desktop apps are potentially hosed for ever?
-
2011年10月14日 12:44版主
Standby for more information about how desktop applications will interact in this way. We have not released any Windows 8 Desktop application programming information as of yet.
-Jeff
Jeff Sanders (MSFT)- 已建议为答案 Jeff SandersMicrosoft Employee, Moderator 2011年10月14日 12:45
- 已标记为答案 Matt SmallMicrosoft Employee, Moderator 2011年10月21日 19:48
-
2011年10月17日 6:53To expand this question, how to send messages via the tray notification with desktop app? Another, what time release windows 8 Desktop application programming information?
-
2011年10月21日 21:52I also would like to know what happens to those critical alerts if the user on the Metro mode has switched off the app alerts...?
-
2011年10月21日 22:56版主
Users have the ultimate control over whether they see toasts or not. If the user turns off app alerts then the user will not receive app alerts. There is no guarantee that a user will see a toast, so they shouldn't be used as the sole channel to communicate critical events.
As the guidelines suggest, if it is critical that the user sees a notification then the notification needs to be displayed somewhere persistent so it is still available when the user is ready to look. Tiles and the app itself are the only such places.
A toast can be used as an additional means, but there is no way to ensure the user will see the toast: toasts may be turned off, the user may be looking away, etc.
--Rob
-
2011年11月22日 2:52
I am very much interested in this topic, since our application may require the user's immediate attention. Currently we have small notification windows that show up on top of all other apps, where the user can take an action or ignore it. Pretty much similar to the Outlook incoming email notification.
Is there a way to notify the user about an imminent action while the user is in another Metro UI application?
My Windows Phone will display an incoming call on top of any other running app for instance. Is there something similar for Windows 8?
Florin
-
2011年11月30日 15:02版主
Standby for more information about how desktop applications will interact in this way. We have not released any Windows 8 Desktop application programming information as of yet.
-Jeff
Jeff Sanders (MSFT) -
2012年3月4日 3:27
Is there any update about toast on Windows 8 Consumer Preview?
Is following volume notification belongs to toast? How to show it in desktop application?
-
2012年3月4日 3:31版主
Hi Harry,
Please see the documentation: Sending toast notifications from desktop apps and Quickstart: Sending a toast notification from the desktop .
--Rob
- 已标记为答案 Rob CaplanMicrosoft Employee, Moderator 2012年3月4日 4:00
-
2012年3月4日 3:57That's great, thanks for quickly response!!
-
2012年3月8日 14:08
Hi there!
One question: Is it possible to change the background and text color of a toast notification send from a desktop application? I did not find anything in the docu...
-
2012年3月13日 16:36
The samples require Visual Studio 11 to build. Is there a way to build toast notification code with Visual Studio 10 by any chance? I don't want to migrate our entire solution to VS 2011, just so we can show a toast from our desktop app... Any thoughts?
- 已建议为答案 Rebecca M. Riordan 2012年3月13日 20:45
-
2012年3月13日 16:45版主
You should be able to use VS10. The code in How to enable desktop toast notifications through an AppUserModelID is straight COM, not C++/Cx.
You would need to convert the actual sample (I didn't check, but this could be as simple as copying the source files into a VS10 project) and you may need newer header files than were included in VS10.
--Rob
-
2012年4月6日 18:36As far as I can tell, in order to use toast, I need to add a new dependency (something .winmd) and only VS 11 recognizes .winmd files and can add them as dependencies to my C# project. I haven't tried C++.
-
2012年4月9日 22:33版主
The C++ Sending toast notifications from desktop apps sample is pure COM and doesn't rely on a winmd file. It should work fine in VS2010 plus the Windows 8 SDK, although it may need some updating if the sample uses new C++ syntax that wasn't available in the older version (nothing jumps out at me, but I don't have VS2010 handy to check).
The C# sample does rely on the winmd file for the Windows Runtime class metadata. You should still be able to send a toast from C# in an older compiler, but you may need to write the pinvoke signatures and runtime-callable wrappers yourself.
You might also try spliting your project and write an assembly with VS11 which can be called from the VS10 assemblies.
--Rob
- 已建议为答案 Rob CaplanMicrosoft Employee, Moderator 2012年4月9日 22:33

