2

I am writing a VB.NET application in VS2017, to run on Windows 10. I want the main (and only) Form to minimize down to a System Tray icon. That part I have working fine. The next part, display a Balloon Tip popup notification (e.g., "Application is still running"), is not working at all.

I have already checked/noted the following:

  • The NotifyIcon object has an icon assigned to it in the designer grid as well as in the vb.net code-behind for the form, as does its associated BalloonTipIcon member/property
  • The Group Policy on the the machine does not appear to forbid the use of Balloon Tips
  • Balloon tips do not appear to be disabled in the registry
  • The program works as expected in Windows 8.1 Pro and displays the BalloonTip, but does not in Windows 10 Enterprise N 2016 LTSB.

The machine is located in a domain that does have Group Policy administration going on, however the resultant policy set found on my machine does not seem to indicate that balloon tips have been disabled.

Copying-and-pasting exact code from StackOverflow does not work. The problem must then be in the system itself.

This is the code (which works on W8.1 but not W10):

Private Sub frmMain_Resize(sender As Object, e As EventArgs) Handles Me.Resize

    Try

        If Me.WindowState = FormWindowState.Minimized Then

            NotifyIcon1.Visible = True
            NotifyIcon1.Icon = SystemIcons.Application
            NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info
            NotifyIcon1.BalloonTipTitle = "App Title"
            NotifyIcon1.BalloonTipText = "The App is still open!"
            NotifyIcon1.ShowBalloonTip(50000)
            ShowInTaskbar = False

        End If

    Catch ex As Exception

        ErrorHandler(ex)

    End Try

End Sub

Where else can I look?

Cross-posted on SuperUser

Trevor
  • 7,777
  • 6
  • 31
  • 50
David Mancini
  • 428
  • 7
  • 20
  • How do you know in fact it's a system issue and not a code problem? What test's have been performed? Also you are talking about two completely different namespaces and objects here; notify icon <> toast. According to your code block, you are just using a notifyicon... – Trevor Aug 15 '18 at 21:40
  • The documentation I've read implies that Windows 10 "replaced" BalloonTips with Toasts, so that a call to BalloonTip would yield a Toast. Perhaps I misunderstood. But as stated in my question, the code works just fine in Windows 8.1; in Windows 10 however, no configuration of any options I have uncovered so far has yielded *anything* on the screen when the `ShowBalloonTip` method is invoked. – David Mancini Aug 15 '18 at 21:53
  • That is to say, all the W10 settings that I've found about **disabling** balloon tips have not been set to do so. So I'm struggling to understand why they're not showing. – David Mancini Aug 15 '18 at 21:55
  • What framework are you targeting? – Trevor Aug 15 '18 at 21:57
  • 4.6.1, code complies to the usage outlined at MSDN https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.notifyicon.showballoontip?view=netframework-4.7.2#System_Windows_Forms_NotifyIcon_ShowBalloonTip_System_Int32_System_String_System_String_System_Windows_Forms_ToolTipIcon_ – David Mancini Aug 15 '18 at 21:59
  • @Codexer Good call on the Toasts vs. Balloon, the code I'm dealing with is not toast related. I've updated the question and title to reflect. Thanks! – David Mancini Aug 15 '18 at 22:35
  • Just for additional clarification, the purpose of this question is ascertaining why this feature is/was not working in Windows 10, specifically. That is why it is in the title. – David Mancini Aug 16 '18 at 04:36
  • And titles shouldn't contain tags. That is why tags exist. Stack Exchange sites have an extensive tagging system which allows users to identify what subjects are involved in a question, watch or ignore certain subjects, narrow their searches to a specific area... https://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles – Trevor Aug 16 '18 at 11:48
  • It is not just a tag, it is a material part of the question. I could just as easily have also tag it Windows 8.1, because that was mentioned in the question, but that is not the point. The point is, it didn't work in Windows 10, and that is why it is in the title. – David Mancini Aug 16 '18 at 14:56
  • Cross-posting is *not* allowed. See [Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site?](//meta.stackexchange.com/a/64069). You'd better quickly decide whether to delete this question or [the other one](//superuser.com/q/1349414). Otherwise, the community will decide for you ;-) – robinCTS Aug 17 '18 at 05:09

3 Answers3

1

So it turns out I fell for one of the oldest tricks in the book. I needed to do a full reboot after altering one the registry keys.

So, for me, making Balloon Tips appear in Windows 10 needed the following:

  1. Open regedit.exe

  2. Navigate to HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced

  3. Set (or add) EnableBalloonTips (as REG_DWORD) and set value to 1

  4. Reboot.

Voilà. Problem solved.

David Mancini
  • 428
  • 7
  • 20
  • Also, for reference, GPO item `User Configuration` > `Administrative Templates` > `Start Menu and Taskbar` >> `Disable showing balloon notifications as toasts` needs to be set to `Enabled` if you've disabled the notification center or other apps sending notifications in the Settings app, or else nothing will show up. – David Mancini Aug 25 '20 at 10:15
0

I have found that even though I had stated the icon in the code I had to also add a icon initially to the notifyIcon1.icon property.

Andrew
  • 11
0

In my case David Mancini response was not enough, I also had to enable "Get notifications from apps and other senders" under Settings -> System -> Notifications & actions enter image description here

MIHOW
  • 21
  • 4