60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#ifndef _HOOKPROC_DESKTOPENUMERATOR_HPP_
|
|
#define _HOOKPROC_DESKTOPENUMERATOR_HPP_
|
|
#ifndef _HOOKPROC_ENUMDESKTOPHOOK_HPP_
|
|
#include <hookproc/enumdesk.hpp>
|
|
#endif
|
|
#ifndef _COMMON_STRING_HPP_
|
|
#include <common/string.hpp>
|
|
#endif
|
|
#ifndef _COMMON_BLOCK_HPP_
|
|
#include <common/block.hpp>
|
|
#endif
|
|
#ifndef _COMMON_WINDOWSTATION_HPP_
|
|
#include <common/wstation.hpp>
|
|
#endif
|
|
|
|
class DesktopEnumerator : public EnumDesktopHook, public Block<String>
|
|
{
|
|
public:
|
|
DesktopEnumerator(void);
|
|
virtual ~DesktopEnumerator();
|
|
bool enumerateDesktops(WindowStation &windowStation);
|
|
DWORD size(void)const;
|
|
protected:
|
|
virtual bool enumDesktopProc(const String &strDesktop);
|
|
private:
|
|
};
|
|
|
|
inline
|
|
DesktopEnumerator::DesktopEnumerator(void)
|
|
{
|
|
}
|
|
|
|
inline
|
|
DesktopEnumerator::~DesktopEnumerator()
|
|
{
|
|
}
|
|
|
|
inline
|
|
bool DesktopEnumerator::enumerateDesktops(WindowStation &windowStation)
|
|
{
|
|
Block<String>::remove();
|
|
if(!windowStation.isOkay())return false;
|
|
::EnumDesktops(windowStation.getHandle(),(LPFNENUMDESKTOPPROC)getHookAddress(),0);
|
|
return Block<String>::size()?true:false;
|
|
}
|
|
|
|
inline
|
|
bool DesktopEnumerator::enumDesktopProc(const String &strDesktop)
|
|
{
|
|
Block<String>::insert(&strDesktop);
|
|
return true;
|
|
}
|
|
|
|
inline
|
|
DWORD DesktopEnumerator::size(void)const
|
|
{
|
|
return Block<String>::size();
|
|
}
|
|
#endif
|