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.

56 lines
1.6 KiB

  1. #if !defined(CTRL__Extension_h__INCLUDED)
  2. #define CTRL__Extension_h__INCLUDED
  3. #pragma once
  4. #if ENABLE_MSGTABLE_API
  5. class DuExtension :
  6. public ExtensionImpl<DuExtension, SListener>
  7. {
  8. // Construction
  9. public:
  10. inline DuExtension();
  11. virtual ~DuExtension();
  12. static HRESULT InitClass();
  13. enum EOptions
  14. {
  15. oUseExisting = 0x00000001, // Use existing Extension if already attached
  16. oAsyncDestroy = 0x00000002, // Use asynchronous destruction
  17. };
  18. HRESULT Create(Visual * pgvChange, PRID pridExtension, UINT nOptions);
  19. void Destroy();
  20. void DeleteHandle();
  21. // Public API
  22. public:
  23. dapi HRESULT ApiOnEvent(EventMsg * pmsg);
  24. dapi HRESULT ApiOnRemoveExisting(Extension::OnRemoveExistingMsg * pmsg);
  25. dapi HRESULT ApiOnDestroySubject(Extension::OnDestroySubjectMsg * pmsg);
  26. dapi HRESULT ApiOnAsyncDestroy(Extension::OnAsyncDestroyMsg * pmsg);
  27. // Operations
  28. public:
  29. static DuExtension* GetExtension(Visual * pgvSubject, PRID prid);
  30. // Implementation
  31. protected:
  32. void PostAsyncDestroy();
  33. // Data
  34. protected:
  35. Visual * m_pgvSubject; // Visual Gadget being "extended"
  36. PRID m_pridListen; // PRID for Extension
  37. BOOL m_fAsyncDestroy:1;
  38. // Need to destroy asynchronously
  39. static MSGID s_msgidAsyncDestroy;
  40. };
  41. #endif // ENABLE_MSGTABLE_API
  42. #include "Extension.inl"
  43. #endif // CTRL__Extension_h__INCLUDED