Rev 153 | Rev 179 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 153 | Rev 164 | ||
|---|---|---|---|
| Line 8... | Line 8... | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | // global variables used in this module only |
10 | // global variables used in this module only |
| 11 | static wchar_t candidate_email[128] = L""; |
11 | static wchar_t candidate_email[128] = L""; |
| 12 | static unsigned __int32 candidate_code = 0; // 32 bits |
12 | static unsigned __int32 candidate_code = 0; // 32 bits |
| - | 13 | static bool was_donatebutton_clicked = false; |
|
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | // prototypes of local functions |
16 | // prototypes of local functions |
| 16 | static int CALLBACK DialogProc_ThisDialog (HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam); |
17 | static int CALLBACK DialogProc_ThisDialog (HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam); |
| 17 | static unsigned __int32 RetrieveActivationCode (wchar_t *candidate_email, wchar_t **failure_reason); |
18 | static unsigned __int32 RetrieveActivationCode (wchar_t *candidate_email, wchar_t **failure_reason); |
| Line 79... | Line 80... | ||
| 79 | ConvertStaticToHyperlink (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_STATUSBAR)); |
80 | ConvertStaticToHyperlink (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_STATUSBAR)); |
| 80 | } |
81 | } |
| 81 | 82 | ||
| 82 | // else did we click the close button on the title bar ? |
83 | // else did we click the close button on the title bar ? |
| 83 | else if (message == WM_CLOSE) |
84 | else if (message == WM_CLOSE) |
| - | 85 | { |
|
| - | 86 | if (was_donatebutton_clicked) |
|
| - | 87 | { |
|
| - | 88 | MessageBox (hWnd, LOCALIZE (L"Registration_DontForget"), PROGRAM_NAME, MB_ICONWARNING | MB_OK); // users need to be reminded that they MUST write their email in the activation form |
|
| - | 89 | SendMessage (GetDlgItem (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS), EM_SETSEL, 0, -1); // select all text |
|
| - | 90 | SetFocus (GetDlgItem (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS)); // focus on the email address field |
|
| - | 91 | was_donatebutton_clicked = false; // once is enough |
|
| - | 92 | return (true); // prevent window close this time |
|
| - | 93 | } |
|
| - | 94 | else |
|
| 84 | EndDialog (hWnd, 0); // close the dialog box |
95 | EndDialog (hWnd, 0); // close the dialog box |
| - | 96 | } |
|
| 85 | 97 | ||
| 86 | // else did we take action on one of the controls ? |
98 | // else did we take action on one of the controls ? |
| 87 | else if (message == WM_COMMAND) |
99 | else if (message == WM_COMMAND) |
| 88 | { |
100 | { |
| 89 | // did we cancel the dialog box ? (IDCANCEL is a system-wide dialog box handler value, that catches the ESC key) |
101 | // did we cancel the dialog box ? (IDCANCEL is a system-wide dialog box handler value, that catches the ESC key) |
| Line 146... | Line 158... | ||
| 146 | 158 | ||
| 147 | if (wcscmp (languages[language_id].name, L"French") == 0) |
159 | if (wcscmp (languages[language_id].name, L"French") == 0) |
| 148 | ShellExecute (NULL, L"open", PAYPAL_URL_FR, NULL, NULL, SW_MAXIMIZE); // open PayPal in French in the default browser, maximized |
160 | ShellExecute (NULL, L"open", PAYPAL_URL_FR, NULL, NULL, SW_MAXIMIZE); // open PayPal in French in the default browser, maximized |
| 149 | else |
161 | else |
| 150 | ShellExecute (NULL, L"open", PAYPAL_URL_XX, NULL, NULL, SW_MAXIMIZE); // open PayPal in English (default) the default browser, maximized |
162 | ShellExecute (NULL, L"open", PAYPAL_URL_XX, NULL, NULL, SW_MAXIMIZE); // open PayPal in English (default) the default browser, maximized |
| - | 163 | ||
| - | 164 | was_donatebutton_clicked = true; // remember the user clicked the Donate button |
|
| 151 | } |
165 | } |
| 152 | 166 | ||
| 153 | // else was it the status bar hyperlink ? |
167 | // else was it the status bar hyperlink ? |
| 154 | else if (wParam_loword == STATICTEXT_REGISTRATION_STATUSBAR) |
168 | else if (wParam_loword == STATICTEXT_REGISTRATION_STATUSBAR) |
| 155 | ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the main page in the default browser, maximized |
169 | ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the main page in the default browser, maximized |