locked
ToastNotification issue of C++ language

    Question

  • Dear All,

    I am using toast notification to post PC shock message on both Desktop and Metro.

    Now I find two problems.

    The first is how to set expiration time of toast notification actively.

    A. Only one toast notification can be posted at one time of my spec.

    B. The expiration time should be reset when the previous toast notification is not timeout but a new PC shock message is coming.

    So these make me should find the way of set expiration time actively.

    The second is how to display a long string on toast notification window.

    It seems that the windows size and the font size cannot be changed.

    So I cannot show all my shock message on the window.

    Please give me some information and advaces if you kown about these.

    Thanks in advance!

    Best Regards,

    xptx

    Monday, April 16, 2012 9:48 AM

Answers

  • Hi xptx,

    There isn't anything automatic for toasts (there is for tiles), but you can do this yourself:

    When you schedule toast you can give it an ID. You can then call RemoveFromSchedule to cancel it. If the toast was Shown immediately rather than being scheduled then you can call ToastNotifier.Hide to hide it.

    Toasts all use standard templates. If your text won't fit in the template then you will need to shorten the text. You might give a quick summary in the toast and then provide more detail when the user clicks on it.

    --Rob

    Monday, April 16, 2012 7:24 PM
    Owner
  • When the user clicks on the toast the toast will go away but your app should be launched. You can include arguments in the toast's launch attribute so the app will know what extended information to display.

    Unfortunately the topic Handle activation from a toast notification isn't finished yet, but see step 4 at How to activate an app and the Toast notifications sample

    --Rob

    • Marked as answer by Jesse Jiang Wednesday, April 25, 2012 7:04 AM
    Thursday, April 19, 2012 10:11 PM
    Owner

All replies

  • Hi xptx,

    There isn't anything automatic for toasts (there is for tiles), but you can do this yourself:

    When you schedule toast you can give it an ID. You can then call RemoveFromSchedule to cancel it. If the toast was Shown immediately rather than being scheduled then you can call ToastNotifier.Hide to hide it.

    Toasts all use standard templates. If your text won't fit in the template then you will need to shorten the text. You might give a quick summary in the toast and then provide more detail when the user clicks on it.

    --Rob

    Monday, April 16, 2012 7:24 PM
    Owner
  • Dear Rob,

    Thanks for your information!

    >When you schedule toast you can give it an ID. You can then call RemoveFromSchedule to cancel it. If the toast was Shown immediately rather than being >scheduled then you can call ToastNotifier.Hide to hide it.

    Thanks, I will try.

    >Toasts all use standard templates. If your text won't fit in the template then you will need to shorten the text. You might give a quick summary in the toast

    Thanks, I got it.

    >and then provide more detail when the user clicks on it.

    Can you gvie me some more detail?

    Currently, the toast notification will disappear if it is clicked.

    Sorry for inconvenience!

    Best Regards,

    xptx

    • Proposed as answer by Chris Guzak Saturday, April 21, 2012 3:22 AM
    Tuesday, April 17, 2012 12:59 AM
  • When the user clicks on the toast the toast will go away but your app should be launched. You can include arguments in the toast's launch attribute so the app will know what extended information to display.

    Unfortunately the topic Handle activation from a toast notification isn't finished yet, but see step 4 at How to activate an app and the Toast notifications sample

    --Rob

    • Marked as answer by Jesse Jiang Wednesday, April 25, 2012 7:04 AM
    Thursday, April 19, 2012 10:11 PM
    Owner
  • Dear Rob,

    Thanks for your kindly help!

    I got it!

    Best Regards,

    xptx



    • Edited by xptx Friday, April 20, 2012 1:12 AM
    Friday, April 20, 2012 1:05 AM
  • Dear All:

    Dear Rob:

    Sorry for bother you again!

    As you may know, when user click the toast notification, the OS will return Metro to Desktop (If user is working on Metro).

    And I expect that the operation should not switch Metro to desktop!

    Do you have any advance?

    Please give me some information if possible!

    Thanks!

    Best Regards,  

    xptx

    Friday, April 27, 2012 3:36 AM
  • Dear All:

    Dear Rob:

    Sorry for bother you again!

    As you may know, when user click the toast notification, the OS will return Metro to Desktop (If user is working on Metro).

    And I expect that the operation should not switch Metro to desktop!

    Do you have any advance?

    Please give me some information if possible!

    Thanks!

    Best Regards,  

    xptx

    Dear all

    i also wish to know how to keep the window on metro.

    thank you very much if you can provide information .

    br

    Friday, April 27, 2012 5:45 AM
  • Hi Xptx,

    When the user clicks the toast notification the application which raised the toast is expected to be activated. If that is a desktop application then the switch to the desktop is expected.

    --Rob

    Tuesday, May 01, 2012 6:50 PM
    Owner
  • Dear Rob-san:

    Thanks for your information!

    Best Regards,

    ZYQ

    Wednesday, May 02, 2012 9:37 AM