mohabouje / WinToast

WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8 & Windows 10. Toast notifications allows your app to inform the users about relevant information and timely events that they should see and take action upon inside your app, such as a new instant message, a new friend request, breaking news, or a calendar event.
MIT License
688 stars 127 forks source link

Add attribution text #27

Closed sraboy closed 6 years ago

sraboy commented 6 years ago

Re: #25 and dependent on #26.

This feature adds an additional text field with the placement="attribution" option set, which puts it in a subdued gray color, next to your application's name. This is where you often see "via SMS" or something similar. Here's an example from an MSDN blog post.

image

This required a change to the Util::createElement() function introduced in #26, allowing you to specify the root node (by the not-necessarily-unique text name, so not robust, but we're not building an XML parser here, right?) below which the new element is created (<audio> goes under <toast> but <text> goes under <binding>).

mohabouje commented 6 years ago

Hey @sraboy !

Sorry, I'm a little bit busy this week. I will try to accept the PR and merge everithing this week end.

BTW, did you test it in Windows 8? I think that the attribute parameter is only allowed in Windows 10, but I'm not sure.

sraboy commented 6 years ago

No problem, I completely understand. I don't have Win8 available to test but you are correct that the attribute is only available on Win10, specifically the Anniversary Update and later. I put a note in the source for that but wasn't sure if you'd want to deal with version testing.

mohabouje commented 6 years ago

You are right!

I will launch some automatic test this week-end and try to dynamically generate the XML in the right way depending of the OS version.

Best regards,