1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#ifndef NULLSOFT_AUTH_LOGINPOPUP_PASSCODE_HEADER
#define NULLSOFT_AUTH_LOGINPOPUP_PASSCODE_HEADER
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#include "./loginPopup.h"
class LoginData;
class LoginDataCredentials;
// notifications
#define NPPN_FIRST (120)
typedef struct __NPPNRESULT
{
NMHDR hdr;
INT_PTR exitCode;
LoginData *loginData;
} NPPNRESULT;
#define NPPN_RESULT (NPPN_FIRST + 0)
class LoginPopupPasscode : public LoginPopup
{
protected:
LoginPopupPasscode(HWND hwnd);
~LoginPopupPasscode();
public:
static HWND CreatePopup(HWND hParent, LoginData *loginData);
protected:
void UpdateLayout(BOOL fRedraw);
void EndDialog(INT_PTR code);
BOOL Validate();
BOOL OnInitDialog(HWND hFocus, LPARAM param);
void OnCommand(UINT commandId, UINT eventType, HWND hControl);
LRESULT OnNotify(UINT controlId, const NMHDR *pnmh);
HBRUSH OnGetStaticColor(HDC hdc, HWND hControl);
LRESULT OnEditboxChar(HWND hEdit, UINT ch);
LRESULT OnEditboxKey(HWND hEdit, UINT vKey, UINT flags);
LRESULT OnEditboxPaste(HWND hEdit, LPCWSTR pszText);
INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
protected:
LoginDataCredentials *loginData;
LPWSTR message;
UINT messageType;
private:
friend static HRESULT CALLBACK LoginPopupPasscode_CreateInstance(HWND hwnd, LPARAM param, LoginPopup **instance);
};
#endif //NULLSOFT_AUTH_LOGINPOPUP_PASSCODE_HEADER
|