ExplorerPatcher icon indicating copy to clipboard operation
ExplorerPatcher copied to clipboard

Erroneous messages to apps in notification area

Open teslasystemsx opened this issue 1 year ago • 2 comments

Hello.

I've noticed an abnormal behavior of some apps in the notification area while using "Windows 10" style taskbar. The problem is that the app, which sits in the notification area, may receive incorrect mouse events from the shell in some cases and therefore incorrectly react to them. To find out what's happening and to avoid timewasting advices like "try to change the color", I tried to diagnose the problem by myself and wrote a simple app, which adds its own icon to the notification area and logs all messages coming from it. I'm using Shell_NotifyIconA function to add the icon and set uCallbackMessage member of the NOTIFYICONDATAA struct to receive incoming messages.

The first problem occurs when you have an app, which removes its icon from the notification area after making a left-click on it (for example, Mozilla Thunderbird has such behavior when corresponding setting is set). So, after the icon disappears, the app, which was located next to the disappeared icon receives erroneous WM_LBUTTONUP message. Additionally, it also becomes highlighted and this highlight can be removed only by left-clicking on it. This occurs only with EP's taskbar, with built-in Windows taskbar there are no any problems. Below is a screenshot to show everything visually.

Screenshot NotificationArea

The second problem is not so bad, but it exists anyway. When you hover a mouse cursor over the app icon in the notification area, this app receives erroneous WM_MOUSEMOVE messages without any reason. The cursor is not moving, but the messages are coming by themselves. And as the first issue, this issue happens with EP's taskbar only, no any problems with built-in taskbar.

Additionally, attached a video. Here is my app, which logs the messages coming from its icon in the notification area. Its icon sits next to the Thunderbird app icon. After left-clicking on the Thunderbird's icon it disappears and my app receives WM_LBUTTONUP event, though no one was clicking on it. Next, you may see, that the icon of my app became highlighted. After left-clicking on it, this highlighting disappears. And after that you may see, that the cursor is standing still, but the app keeps receiving WM_MOUSEMOVE messages.

Video

https://github.com/valinet/ExplorerPatcher/assets/140281857/b7ed2733-ee01-4ed5-b393-12e1109659eb

Testing was done on Windows 11 23H2 22631.3447 with EP 22621.3527.65.5

teslasystemsx avatar May 18 '24 16:05 teslasystemsx

That's interesting. Have you tested your app with older windows versions, StartAllBack?

Simplestas avatar May 19 '24 22:05 Simplestas

That's interesting. Have you tested your app with older windows versions, StartAllBack?

I have not tested my app on earlier Windows, but in 22631.2428 there was the same behavior with other apps. Just tested StartAllBack, it has the same issue with WM_MOUSEMOVE messages, but there is no issue with erroneous WM_LBUTTONUP message and no issue with icon highlighting.

If interested, attached a Delphi code, it was written only for diagnostics and simply logs incoming messages from its icon in the notification area, nothing more.

TestApp

teslasystemsx avatar May 20 '24 05:05 teslasystemsx