loginStatus.h 850 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef NULLSOFT_AUTH_LOGIN_STATUS_HEADER
  2. #define NULLSOFT_AUTH_LOGIN_STATUS_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../../nu/Vectors.h"
  8. class LoginStatus
  9. {
  10. protected:
  11. LoginStatus(HWND hTarget);
  12. ~LoginStatus();
  13. public:
  14. static HRESULT CreateInstance(HWND hTarget, LoginStatus **instance);
  15. public:
  16. ULONG AddRef();
  17. ULONG Release();
  18. UINT Add(BSTR status);
  19. BOOL Set(UINT cookie, BSTR status);
  20. void Remove(UINT cookie);
  21. BOOL AttachWindow(HWND hTarget);
  22. BOOL DetachWindow();
  23. protected:
  24. BOOL UpdateWindowText();
  25. UINT GetNextCookie();
  26. protected:
  27. typedef struct __Record
  28. {
  29. UINT cookie;
  30. BSTR text;
  31. } Record;
  32. typedef Vector<Record> RecordList;
  33. protected:
  34. ULONG ref;
  35. HWND hwnd;
  36. RecordList list;
  37. CRITICAL_SECTION lock;
  38. };
  39. #endif //NULLSOFT_AUTH_LOGIN_STATUS_HEADER