简体   繁体   中英

How to get hidden windows handle of the windows that show hidden system tray icons

I am trying to write application in C# that catch the handle of the hidden windows that appear when pressing the button ("Show hidden icons").

When we don't show all the notification area we have hidden system tray icons.

When we press on the button ("Show hidden icons") that show them we have a new window that all the icons inside it:
在此处输入图片说明
The hidden windows marked with green circle

How can I catch the handle of this hidden window ?

When I used Spy++ I couldn't find this window because the windows dissapears when I click any other key on the keyboard.

So I found the handle of the button and used the logging option:
在此处输入图片说明

In the logging results I only saw windows handles of the regular system tray tool bar:
在此处输入图片说明

So how can I catch the handle of the hidden window (the one I marked with green in the begging of my question, first pictuare).

References (links I found but didn't help me):
How to capture Notification icons properties using Microsoft Spy++
Get information about hidden tray icons in windows7

I succeed !

I succeed to catch it with Spy++:

在此处输入图片说明

在此处输入图片说明

Code solution:

static IntPtr GetHiddenSystemTrayHandle()
{
    IntPtr hWndTray = User32.FindWindow("NotifyIconOverflowWindow", null);
    if (hWndTray != IntPtr.Zero)
    {
            if (hWndTray != IntPtr.Zero)
            {
                // Windows caption "Overflow Notification Area"
                hWndTray = User32.FindWindowEx(hWndTray, IntPtr.Zero, "ToolbarWindow32", null);
                return hWndTray;
            }
    }

    return IntPtr.Zero;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM