Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
1.4 KiB

//
// shellwnd.h
//
#ifndef _SHELLWND_H_
#define _SHELLWND_H_
#include <shlapip.h>
class CShellWndThread
{
public:
CShellWndThread()
{
Clear();
}
void Clear()
{
_hwndTray = NULL;
_hwndProgman = NULL;
#ifdef LAYTER
_dwThreadIdTray = 0;
_dwThreadIdProgman = 0;
#endif
}
HWND GetWndTray()
{
if (!_hwndTray || !IsWindow(_hwndTray))
_hwndTray = FindWindow(TEXT(WNDCLASS_TRAYNOTIFY), NULL);
return _hwndTray;
}
HWND GetWndProgman()
{
if (!_hwndProgman || !IsWindow(_hwndProgman))
_hwndProgman = FindWindow("Progman", NULL);
return _hwndProgman;
}
#ifdef LAYTER
DWORD GetWndTrayThread()
{
if (!GetWndTray())
_dwThreadIdTray = 0;
else if (!_dwThreadIdTray)
_dwThreadIdTray = GetWindowThreadProcessId(_hwndTray, NULL);
return _dwThreadIdTray;
}
DWORD GetWndProgmanThread()
{
if (!GetWndProgman())
_dwThreadIdProgman = 0;
else if (!_dwThreadIdProgman)
_dwThreadIdProgman = GetWindowThreadProcessId(_hwndProgman, NULL);
return _dwThreadIdProgman;
}
#endif
private:
HWND _hwndTray;
HWND _hwndProgman;
#ifdef LAYTER
DWORD _dwThreadIdTray;
DWORD _dwThreadIdProgman;
#endif
};
#endif _SHELLWND_H_