desktop-toasts | raw samples for desktop toasts using com activation | Dektop Application library

 by   WindowsNotifications C++ Version: Current License: MIT

kandi X-RAY | desktop-toasts Summary

kandi X-RAY | desktop-toasts Summary

desktop-toasts is a C++ library typically used in Apps, Dektop Application applications. desktop-toasts has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

raw samples for desktop toasts using com activation
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              desktop-toasts has a low active ecosystem.
              It has 91 star(s) with 20 fork(s). There are 16 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 9 open issues and 6 have been closed. On average issues are closed in 148 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of desktop-toasts is current.

            kandi-Quality Quality

              desktop-toasts has 0 bugs and 0 code smells.

            kandi-Security Security

              desktop-toasts has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              desktop-toasts code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              desktop-toasts is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              desktop-toasts releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of desktop-toasts
            Get all kandi verified functions for this library.

            desktop-toasts Key Features

            No Key Features are available at this moment for desktop-toasts.

            desktop-toasts Examples and Code Snippets

            No Code Snippets are available at this moment for desktop-toasts.

            Community Discussions

            QUESTION

            Diagnosing and Resolving a ToastNotification Exception
            Asked 2022-Mar-01 at 19:34

            QUESTION:
            My simple Windows notification application throws an exception with the error message "Access is denied." How can I fix this?

            PREFACE:
            The structure in use is prescribed by the current implementation of and constraints placed on our application. While a better structure than this may exist, changing the structure is not an option at this time.

            Relevant structural information:
            We have a service that always runs. This service will spawn a process--let's call it data.exe--for every active session ID on the machine. For example, if there are currently four sessions active on the server with session IDs 1-4, data.exe will be running for all 4 sessions. Notably, the user name in Task Manager for each process is SYSTEM, despite running in non-zero session IDs.

            INFORMATION:
            My application--toaster.exe--is supposed to be launched from a different process via CreateProcessW(). The full launch function is adapted from a Raymond Chen blog post found here. As a brief explanation of what this function does, it launches a program with the shell as its parent process. For clarity, I implemented this function into data.exe to launch toaster.exe, and the adaptations I made are simply to handle errors and, obviously, to launch the particular program I want, rather than cmd.exe. Mr. Chen's function was the only method I found that would successfully and reliably launch my application and have it perform as intended.

            Currently, if I launch toaster.exe by clicking on it, it performs its functions perfectly. I can also confirm that I am able to launch toaster.exe from another process--I setup a test application that can successfully launch toaster.exe in such a way that it does not throw an exception. To clarify what I mean by "functions perfectly," toaster.exe successfully sends me a simple one-line notification with a message that I have hardcoded for testing purposes.

            However, if I launch toaster.exe from a program that was launched by our service, it hits an exception when it attempts to create the winrt::Windows::UI::Notifications::ToastNotification object. Unfortunately, this last one is the only launch method I care about--this program needs to be compatible with being launched in this way because it will always be launched by data.exe, which, as mentioned in the preface, is launched by our service.

            Here is the function in toaster.exe where the exception occurs:

            ...

            ANSWER

            Answered 2022-Mar-01 at 19:34

            EDIT 2022/2/28:
            I have found a more elegant solution to this problem involving WTSQueryToken() and GetTokenInformation() thanks to this SO answer.

            WTSQueryToken() returns a filtered user token, and without any extra steps, this token can be placed into a CreateProcessAsUserW() call to spawn my notification app.

            I opt to call GetTokenInformation() to obtain the unfiltered (read: elevated) token for the user, which allows me to keep all my application's logs centralized in the Program Files directory. I am unclear if a process launched with an unfiltered token of a user without admin privileges will still be able to log to the Program Files directory, but this is non-essential to the process's ability to run.

            SOLUTION:
            The error message given for the thrown exception is Access is denied. This may or may not be the result of a bug related to the PROC_THREAD_ATTRIBUTE_PARENT_PROCESS flag. The workaround for this is simply to spawn the process again from the child process, using the exact same function call minus the problematic flag.

            In my case, I pass a parameter that acts as a flag to tell the child process that it needs to relaunch itself.

            EXPLANATION:
            Thanks to the guidance of @IInspectable, I was able to resolve my issue.

            Firstly, IInspectable informed me that the exception's data type was likely that of a winrt::hresult_error, which ended up being correct. From this, I was able to see that the exception message was Access is denied.

            After updating my question to reflect this, IInspectable returned to point me towards the bottom of the comments of the Raymond Chen blog post that I linked in my question.

            In short, the comment suggests that there is an underlying bug in the API that causes processes spawned in the way demonstrated by Chen to load with incorrect parameters, and offers a simple workaround by using Chen's function from within the child process to launch another child process. The comment also suggests that removing the PROC_THREAD_ATTRIBUTE_PARENT_PROCESS flag from the second function call is necessary, but this is not something I needed to do for the workaround to succeed.

            For posterity, the comment from the blog post comments is as follows:

            There are issues using the PROC_THREAD_ATTRIBUTE_PARENT_PROCESS flag… Environment variables for the new process are copied from the High-IL process not the Medium-IL process which cause issues with shell functions and some directory paths (%temp%, %userprofile% etc…) The token security descriptor for the process is also created without an ACE for the current user blocking access to most resources and the token security descriptor will also have a High-IL even though the process itself has a Medium-IL… This blocks the new process from accessing any system objects (events/pipes/sections/IPC etc…) while also blocking the process from opening its own process token with TOKEN_QUERY access. This seems to be a severe bug with the API but not sure if it’ll be fixed. As a workaround you can call CreateProcess a second time but from the new child process (without the PARENT_PROCESS flag) and it’ll be created with the correct token DAC security and environment variables (this is also why the above above sample doesn’t have issues with cmd.exe since it launches child processes).

            Source https://stackoverflow.com/questions/71132035

            QUESTION

            How can I integrate toast notifications in WPF app?
            Asked 2020-Aug-23 at 19:03

            I wanted to add toast notifications to my wpf app.

            I've followed the Send a local toast notification from desktop C# apps from Microsoft, but I'm stuck on the step 5.

            I'm not sure how to make this code working:

            ...

            ANSWER

            Answered 2020-Aug-23 at 19:03

            NEW:

            There is a way of using UWP Toast Notifications in WPF app.

            1. Add 10.0 to .csproj
            2. If you have any package installed, click on packages.config file and select Migrate packages.config to PackageReference... (Important step - this was the thing that I was missing)
            3. Now in Package Manager Console install UWP.Notifications package e.g.: Install-Package Microsoft.Toolkit.Uwp.Notifications -Version 6.1.1 Check version

            Now, you should be able to use all uwp notification functions.

            OLD:

            As @Andy suggested in the comments there is ready NuGet package implementation: github.com/Federerer/Notifications.Wpf

            If you just want a simple notification without onClick events etc. you can use this solution:

            1. Add 10.0 to .csproj
            2. Add references to Windows.UI and Windows.Data
            3. Add following usings: using Windows.Data.Xml.Dom; using Windows.UI.Notifications;
            4. Use this code to show notification:

            Source https://stackoverflow.com/questions/63547755

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install desktop-toasts

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/WindowsNotifications/desktop-toasts.git

          • CLI

            gh repo clone WindowsNotifications/desktop-toasts

          • sshUrl

            git@github.com:WindowsNotifications/desktop-toasts.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link