Mute Windows 10 Notification using C# or WPF - c#

I'm currently researching on how to mute the windows 10 notification but it i havent found any concrete solution yet.
What i want to do is to disable all notifications when i press a button or check a checkbox.
It is similar on what you do on the notification settings, but i want it to do it progmatically on my application.
I'm currently reading the document of microsoft about Notification Listener.
https://learn.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/notification-listener

NotificationListener allows you to access the notifications, but not to the configuration of the system. And you must think it's a UWP Api...
You want to do something that can not be done in UWP Api(impossible) nor WPF(possible, i wish you good luck).
You can't change system settings inside the UWP app box -safety and things-. The way to do it is "Open the Configuration App where you want the user make the change".
If you wan't to this in WPF/.net you'd have to play with PInvoke and WinApi seriously. And that means thinking about privileges, run as admin, find the functions in WinApi .h files, etc...
Keeping simple, in UWP, nope; in WPF, you have to read a lot of source code/documentation of Windows .h files, make the c# version of the structs, etc...
The real question here is... It's necessary? Windows provides Focus Assist with two clicks (corner, Focus Assist)

I really appreciate your feedbacks! I did some tinkering and found out the service responsible for the notification. I'm not really confident that this is the best approach, but it is working for me.
What I did was I stopped the service using C#. Here is my sample code:
ServiceController[] services = ServiceController.GetServices();
foreach (ServiceController service in services)
{
if (service.ServiceName.Contains(serviceName))
{
service.Start();
}
}
Here is the service responsible for the notifications:
Notification Service
I dont know if this is a good practice or not so I'm still open for feedbacks and suggestions.
Thank you!

Related

Notification icon and balloon messages in c# cross-platform

I'm going to develop a desktop application which is a sort of background service listening for events. The requirements for this application are:
tray icon in background always visible
show up notifications on desktop when an event occurs (like receive an email such as, you will notify with a popup)
The main problem is that the application must run under Windows,Mac and Linux.
I decided to develop the main business logic in .NET Core, but I have a few problems about the front-end part; using Windows.Forms.NotifyIcon it's easy, but obviously this solution isn't valid for other platforms.
So, I found GtkSharp project, in particular the StatusIcon object seems to do exactly what I need, except for the notification part. What I need is a sort of balloon info which is already part of Windows.Forms.NotifyIcon, but not in Gtk. Does anyone know if there is a library or a component that allow me to achieve my requirements for a cross-platform context?
[UPDATE]
I asked directly in GtkSharp channel and they told me that is not possible do what I need with GtkSharp (moreover StatusIcon is deprecated and removed from GTK 4).
I found another interesting possible way, seems that Electron framework support all my requirements. Is a different approch, but it covers all what I need and works well on MacOs,Windows and Linux.

How to manipulate app from my own unity app? Unity

I´ve got no code to show, I just wanted to know if you guys could guide me so I can begin my research to start my project. Well, imagine you have a videogame or an app on your computer. How could I control some components that belong to the app from another device. I mean, I want to create an app for mobile devices that allow me to control some components from a specific computer app. My app would be created on Unity. Thank you.
You can achieve this by creating an app on your PC that receives messages from an app on your phone, then uses windows API hooks to fake key presses.
It's a really big and broad question you've asked, so it is hard to add too much more unless you are very specific.

C#/Metro implementing background service

Is it possible to implement service that starts on startup and monitors users acitivity only using Metro WinRT and API? I need somehow figure out a way to get information that user started watching video. I know that it is possible to implement it in normal .NET (by kernel functions), but I would like to know whether this is possible on WinRT tablets. Maybe by creating some triggers.
Thanks
No, fortunately as Raymond said - it is not possible. You can monitor only applications that you create yourself with code that comes with them. Or you could create a library that does monitoring you want and ask developers of applications to use it - basically what vendors of analytics libraries would do.

programmatically access the battery settings in wp7.1

So I found an app on the marketplace that acts as a shortcut for the bluetooth, WiFi and Network settings, you can create a tile for each or use one for all...
one tap and you access this certain setting.
I want to make one but I cannot seem to figure out how, I found some homebrew stuff, but I want to do it professionally, andy idea?
The apps you refer to are just wrapping calls to ConnectionSettingsTask.
There is no equivalent functionality for batteries exposed by the SDK.

wp7 add alarm entry

Is there a way to programmatically add an alarm entry from the app I am creating?
No, currently the SDK doesn't offer any capabilities to interact with systems applications like the Alarms app from a third-party application. I am sure there is a native hook for this (considering the way apps interact internally), but it's not publicly available right now.

Categories