Windows2003-3790/windows/advcore/duser/engine/ctrl/oldextension.h
2020-09-30 16:53:55 +02:00

51 lines
1.5 KiB
C++

#if !defined(CTRL__OldExtension_h__INCLUDED)
#define CTRL__OldExtension_h__INCLUDED
#pragma once
class OldExtension
{
// Construction
public:
inline OldExtension();
virtual ~OldExtension();
enum EOptions
{
oUseExisting = 0x00000001, // Use existing Extension if already attached
oAsyncDestroy = 0x00000002, // Use asynchronous destruction
};
HRESULT Create(HGADGET hgadChange, const GUID * pguid, PRID * pprid, UINT nOptions);
void Destroy();
void DeleteHandle();
// Implementation
protected:
virtual void OnRemoveExisting();
virtual void OnDestroySubject();
virtual void OnDestroyListener();
virtual void OnAsyncDestroy();
void PostAsyncDestroy();
static OldExtension * GetExtension(HGADGET hgadSubject, PRID prid);
private:
static HRESULT CALLBACK
ListenProc(HGADGET hgadCur, void * pvCur, EventMsg * pmsg);
// Data
protected:
HGADGET m_hgadSubject; // Gadget being "extended"
HGADGET m_hgadListen; // Listener for destruction
PRID m_pridListen; // PRID for Extension
BOOL m_fAsyncDestroy:1;
// Need to destroy asynchronously
static MSGID s_msgidAsyncDestroy;
};
#include "OldExtension.inl"
#endif // CTRL__OldExtension_h__INCLUDED