How to show a notification on the screen without affecting the active application

Asked

Viewed 2,135 times

3

How do I show a notification without affecting the active application? In short, I want the notification to be displayed on the screen and the active application not to lose focus, or if it is a full screen application, I want it not to be minimized.

  • 6

    What type of notification?

  • 1

    As far as I know, it’s not possible. If you focus on your application, you automatically minimize the application that is on the screen at the moment (if it is full screen). You can use the Windows API, with direct calls to the DLL’s of the system, but it is not certain that your message will appear without minimizing the application in full screen. That really goes for messages like toltips in the clock-side tray. It is even more uncertain if the full-screen application uses 3D acceleration. Good luck.

  • They suspended for not being clear more the author of the above comment understood... I who did not understand the suspension. Thanks @Renan, I found a way to do this, I researched a little more and found: Growlwpfnotification

  • @Jonathanscripter vote to reopen. I hope the question is reopened, so you can share your solution.

  • I also voted to reopen

  • 2

    How are you doing this ? Wpf ? windows Forms .. specify what type of notification you want and what method you are using, do it in various ways. But answering your question to show a notification without affecting the active application you should run on a separate Thread, I suggest you Create a new Task and Invoke on the object you want to show.

  • I believe it is possible (kind of in the gambiarra), but I don’t have much knowledge of C# and Windows API to provide an example, maybe you could create your own notification in a separate project, ie it be a .exe and would be called by its main application. Note: reinforcement that I have no knowledge about C# for Desktop development.

  • 1

    Notification can be understood in many ways, and depends on the OS and the desktop manager in question (where applicable). Other than that, there are a lot of other things. I believe that the question can be edited and improved with the details that have already been requested in this and other comments.

Show 3 more comments

1 answer

1

I didn’t understand your question very well but it seems to me that you are developing a windows form application. You could make a notification of those that appear on the taskbar with the code below:

        NotifyIcon notifyIcon = new NotifyIcon();
        notifyIcon.Visible = true;
        notifyIcon.Icon = SystemIcons.Information;
        notifyIcon.BalloonTipTitle = "Título";
        notifyIcon.BalloonTipText = "Texto da Notificação";
        notifyIcon.ShowBalloonTip(30000);

I hope I’ve helped. If that’s not what you want explain better please.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.