import win32con
taskbar = win32gui.FindWindow('Shell_TrayWnd', None)
trayArea = win32gui.FindWindowEx(taskbar, None, 'TrayNotifyWnd', None)
win32gui.SetForegroundWindow(taskbar)
Putting the focus on the tray icons in Windows XP using Python