private static IntPtr GetSysTrayWnd() { IntPtr handle = FindWindow("Shell_TrayWnd", null); handle = FindWindowEx(handle, IntPtr.Zero, "TrayNotifyWnd", null); if (IsWindowsXP || IsWindows2000 || IsWindows2003 || IsWindowsVista || IsWindows7) { if (IsWindows2000) { handle = FindWindowEx(handle, IntPtr.Zero, "ToolbarWindow32", null); return handle; } else { handle = FindWindowEx(handle, IntPtr.Zero, "SysPager", null); handle = FindWindowEx(handle, IntPtr.Zero, "ToolbarWindow32", null); return handle; } } else { return handle; } } |