pageAddress.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef NULLSOFT_AUTH_LOGIN_PAGE_ADDRESS_HEADER
  2. #define NULLSOFT_AUTH_LOGIN_PAGE_ADDRESS_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./loginPage.h"
  7. #define NLPAM_FIRST (NLPM_PAGEFIRST + 0)
  8. #define NLPAM_SETADDRESS (NLPAM_FIRST + 0) //wParam = (WPARAM)(BOOL)replaceUsername, lParam = (LPARAM)(LPCWSTR)pszAddress; Return - TRUE on succeess.
  9. #define LoginPageAddress_SetAddress(/*HWND*/ __hwnd, /*LPCWSTR*/ __address, /*BOOL*/ __replaceUsername)\
  10. ((BOOL)SNDMSG((__hwnd), NLPAM_SETADDRESS, (WPARAM)(__replaceUsername), (LPARAM)(__address)))
  11. #define NLPAM_SETADDRESSTITLE (NLPAM_FIRST + 1) //wParam - not used, lParam = (LPARAM)(LPCWSTR)pszAddressTitle; Return - TRUE on succeess.
  12. #define LoginPageAddress_SetAddressTitle(/*HWND*/ __hwnd, /*LPCWSTR*/ __addressTitle)\
  13. ((BOOL)SNDMSG((__hwnd), NLPAM_SETADDRESSTITLE, 0, (LPARAM)(__addressTitle)))
  14. #define NLPAM_SETMESSAGE (NLPAM_FIRST + 2) //wParam - not used, lParam = (LPARAM)(LPCWSTR)pszMessage; Return - TRUE on succeess.
  15. #define LoginPageAddress_SetMessage(/*HWND*/ __hwnd, /*LPCWSTR*/ __pszMessage)\
  16. ((BOOL)SNDMSG((__hwnd), NLPAM_SETMESSAGE, 0, (LPARAM)(__pszMessage)))
  17. class LoginPageAddress : public LoginPage
  18. {
  19. protected:
  20. LoginPageAddress(HWND hwnd, HWND hLoginbox);
  21. ~LoginPageAddress();
  22. public:
  23. static HWND CreatePage(HWND hLoginbox, HWND hParent);
  24. protected:
  25. void UpdateLayout(BOOL fRedraw);
  26. BOOL OnInitDialog(HWND hFocus, LPARAM param);
  27. void OnDestroy();
  28. BOOL OnGetLoginData(LoginData **ppLoginData);
  29. BOOL OnSetUsername(LPCWSTR pszUsername);
  30. HBRUSH OnGetStaticColor(HDC hdc, HWND hControl);
  31. BOOL OnSetAddress(LPCWSTR pszAddress, BOOL replaceUsername);
  32. BOOL OnSetAddressTitle(LPCWSTR pszTitle);
  33. BOOL OnSetMessage(LPCWSTR pszMessage);
  34. INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  35. private:
  36. friend static HRESULT CALLBACK LoginPageAddress_CreateInstance(HWND hwnd, HWND hLoginbox, LoginPage **instance);
  37. };
  38. #endif //NULLSOFT_AUTH_LOGIN_PAGE_ADDRESS_HEADER