loginNotifier.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef NULLSOFT_AUTH_LOGIN_NOTIFIER_HEADER
  2. #define NULLSOFT_AUTH_LOGIN_NOTIFIER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. class LoginGuiObject;
  8. HWND LoginNotifier_CreateWindow(UINT styleEx, UINT style, INT x, INT y, INT cx, INT cy, HWND hParent, INT controlId);
  9. #define NLNTYPE_INFORMATION 0
  10. #define NLNTYPE_WARNING 1
  11. #define NLNTYPE_ERROR 2
  12. #define NLNTYPE_QUESTION 3
  13. #define NLNM_FIRST (WM_USER + 10)
  14. #define NLNM_NOTIFY (NLNM_FIRST + 0) // wParam = (WPARAM)(INT)notificationType, lParam = (LPARAM)(LPCWSTR)notificationText; Return - TRUE on success; notificationText can be MAKEINTRESOURCE(authError)
  15. #define LoginNotifier_Notify(/*HWND*/ __hwnd, /*INT*/ __notificationType, /*LPCWSTR*/ __notificationText)\
  16. (SNDMSG((__hwnd), NLNM_NOTIFY, (WPARAM)(__notificationType), (LPARAM)(__notificationText)))
  17. #define NLNM_GETIDEALHEIGHT (NLNM_FIRST + 1) // wParam - not used, lParam - not used; Return - ideal height
  18. #define LoginNotifier_GetIdealHeight(/*HWND*/ __hwnd)\
  19. ((INT)SNDMSG((__hwnd), NLNM_GETIDEALHEIGHT, 0, 0L))
  20. #define NLNM_SETBKCOLOR (NLNM_FIRST + 2) // wParam - not used, lParam = (LPARAM)(COLORREF)rgb; Return ignored
  21. #define LoginNotifier_SetBkColor(/*HWND*/ __hwnd, /*COLORREF*/ __rgb)\
  22. (SNDMSG((__hwnd), NLNM_SETBKCOLOR, 0, (LPARAM)(__rgb)))
  23. #define NLNM_GETBKCOLOR (NLNM_FIRST + 3) // wParam - not used, lParam - not used; Return back color
  24. #define LoginNotifier_GetBkColor(/*HWND*/ __hwnd)\
  25. ((COLORREF)SNDMSG((__hwnd), NLNM_GETBKCOLOR, 0, 0L))
  26. #define NLNM_SETTEXTCOLOR (NLNM_FIRST + 4) // wParam - not used, lParam = (LPARAM)(COLORREF)rgb; Return ignored
  27. #define LoginNotifier_SetTextColor(/*HWND*/ __hwnd, /*COLORREF*/ __rgb)\
  28. (SNDMSG((__hwnd), NLNM_SETTEXTCOLOR, 0, (LPARAM)(__rgb)))
  29. #define NLNM_GETTEXTCOLOR (NLNM_FIRST + 5) // wParam - not used, lParam - not used; Return back color
  30. #define LoginNotifier_GetTextColor(/*HWND*/ __hwnd)\
  31. ((COLORREF)SNDMSG((__hwnd), NLNM_GETTEXTCOLOR, 0, 0L))
  32. #define NLNM_PLAYBEEP (NLNM_FIRST + 6) // wParam - not used, lParam - not used; Return ignored
  33. #define LoginNotifier_PlayBeep(/*HWND*/ __hwnd)\
  34. (SNDMSG((__hwnd), NLNM_PLAYBEEP, 0, 0L))
  35. #define NLNM_GETIDEALSIZE (NLNM_FIRST + 7) // wParam - not used, lParam - (LPARAM)(SIZE*)sizeOut; Return TRUE on success
  36. #define LoginNotifier_GetIdealSize(/*HWND*/ __hwnd, /*SIZE* */ __sizeOut)\
  37. ((BOOL)SNDMSG((__hwnd), NLNM_GETIDEALSIZE, 0, (LPARAM)(__sizeOut)))
  38. #endif //NULLSOFT_AUTH_LOGIN_NOTIFIER_HEADER