Giter Club home page Giter Club logo

desktoptoast's People

Contributors

emoacht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

desktoptoast's Issues

Why is there not an update interface here?

https://docs.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/toast-progress-bar?tabs=xml
`using Windows.UI.Notifications;

public void UpdateProgress()
{
// Construct a NotificationData object;
string tag = "weekly-playlist";
string group = "downloads";

// Create NotificationData and make sure the sequence number is incremented
// since last update, or assign 0 for updating regardless of order
var data = new NotificationData
{
    SequenceNumber = 2
};

// Assign new values
// Note that you only need to assign values that changed. In this example
// we don't assign progressStatus since we don't need to change it
data.Values["progressValue"] = "0.7";
data.Values["progressValueString"] = "18/26 songs";

// Update the existing notification's data by using tag/group
ToastNotificationManager.CreateToastNotifier().Update(data, tag, group);

}`

I want to add a progress bar and update the percent value realtime.

XML Notification Not Working as expected

HOW ITS SUPPOSED TO LOOK :-
Annotation 2021-04-09 134340

HOW IT REALLY LOOKS :-
image

Contents of "CrashAlert.xml" :-

<toast>
	<visual>
		<binding template="ToastGeneric">
			<image placement="appLogoOverride" src="./warn.ico"/>
			<text>Potential Crash Warning</text>
			<text>It is Recomended to Save any Unsaved Progress within 30 Seconds.</text>
		</binding>
	</visual>
	<audio src="ms-winsoundevent:Notification.Reminder"/>
</toast>

C# Code (modified DesktopToast.Proxy) :-

using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;

namespace DesktopToast.Proxy
{
	class Program
	{
		static void Main(string[] args)
		{
			if (!args.Any())
			{
				Console.WriteLine(" Usage :-");
				Console.WriteLine(" notify.exe [AppName] [xml-file-path]");
				return;
			}

			string xml_path = @args[1];

			if (!File.Exists(xml_path))
			{
				Console.WriteLine("XML File Not Found !");
				return;
			}

			string readText = XDocument.Load(xml_path).ToString();

			var request = new ToastRequest
			{
				ToastXml = readText,
				ToastTitle = "DesktopToast WPF Sample",
				ToastBody = "This is a toast test.",
				ShortcutFileName = args[0] + ".lnk",
				ShortcutTargetFilePath = Assembly.GetExecutingAssembly().Location,
				AppId = args[0],
			};

			ToastManager.ShowAsync(request).Wait();
		}
	}
}

Does this library even support Windows 10 xml toasts ? or do i need windows 8 style xml ?

EDIT : Solved it by using absolute paths, but how can i use absolute paths in xml ?

and how to change the timeout ?

Why use WMI?

I noticed you are using WMI to query the Windows version, if you don't mind me asking.. why? Does this have an advantage over using the Environment.OSVersion.Version?

I am asking, as I always want to learn better ways. I know, as the developer of Greenshot, that Windows sometimes works in mysterious ways and the most obvious way is not the best.

I currently use Environment.OSVersion.Version, as in the code (which is for the next Greenshot) here: https://github.com/dapplo/Dapplo.Windows/blob/master/src/Dapplo.Windows.Common/WindowsVersion.cs

P.S.
I do know that without having an app.manifest telling Windows that you are "version" aware, you wouldn't get to know it's Windows 10 you are running on.

Split logic for showing the toast and installing a shortcut

If I understand it correctly, the application which wants to show toasts only needs to install the shortcut once. So to prevent running code which is only needed once, at every time the application wants to show a toast, I would suggest splitting the logic into multiple steps (and classes).

This also would improve the readability of the code.

Toast never times out

Steps to reproduce:

  1. Delete DesktopToast.Wpf.lnk
  2. Run DesktopToast.Wpf.exe
  3. Minimize all other windows
  4. Click Show a Toast
  5. Close after the toast is shown but before it times out
  6. The toast gains focus and doesn't go away

Windows.winmd file size

I tried to use DesktopToast in CHDK Utility to notify the user when the card is ejected. However, when I tried to post the zipped binaries on the forum, I noticed that there was a size limit of 1500 KB. Windows.winmd alone occupies 2.07 MB (uncompressed), so I had to remove it.

Would it be possible to use DesktopToast without Windows.winmd bundled or at least with a slimmer version that would only contain the relevant API?

Thanks!

Exception on Windows 7

I'm getting the following exception on Windows 7:

System.TypeLoadException: Could not find Windows Runtime type 'Windows.Data.Xml.Dom.XmlDocument'. ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
   --- End of inner exception stack trace ---
   at DesktopToast.ToastManager.<ShowAsync>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at DesktopToast.ToastManager.ShowAsync(ToastRequest request)

The icon exe is not shown in the notification center

Hi, i don't understand why the executable icon is no longer shown in the windows 10 notification center.
I set the icon in the executable properties but it is not shown on the notification group.

Thanks for support.

Process will be terminated after a short time

If my program is started in response to a Toast being clicked it will be forcibly terminated after a minute or so.
I raised this on Stack Overflow here, and the answer is that CoAddRefServerProcess should be called to notify the COM manager that the server is in use.
This library should do the call itself, as it handles the rest of the COM part.

How do you clear history?

I see no way to clear history of the toast notifications. If they user does not activate the toast then it just lingers in the notification area. In most cases that would be best but in the case of my application which logs people out after a certain amount of time and a toast alerts them this is happening then they log back in and that notification is still there.

ToastNotificationManager.History.Clear(); is what I have read up on but not working. Sorry, this is above my head.

The project cannot be compiled.

The project cannot be compiled with the following error: (VS2015)
Cannot apply indexing with [] to an expression of type 'XmlNodeList'.
CS1660 Cannot convert lambda expression to type 'TypedEventHandler<ToastNotification, object>' because it is not a delegate type.
CS1545 Property, indexer, or event 'ToastNotification.Dismissed' is not supported by the language; try directly calling accessor methods 'ToastNotification.add_Dismissed(TypedEventHandler<ToastNotification, ToastDismissedEventArgs>)' or 'ToastNotification.remove_Dismissed(EventRegistrationToken)'
and so on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.