diff options
Diffstat (limited to 'protocols/VKontakte/src/vk_options.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_options.cpp | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index a854a9f335..27d4a902f4 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -22,8 +22,73 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. INT_PTR CALLBACK VKAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- return 0;
-};
+ CVkProto* ppro = (CVkProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+
+ ppro = (CVkProto*)lParam;
+ SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
+
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
+
+ SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_LIMITTEXT, 30, 0);
+ {
+ ptrT tszLogin( ppro->getTStringA("Login"));
+ if (tszLogin != NULL)
+ SetDlgItemText(hwndDlg, IDC_LOGIN, tszLogin);
+
+ ptrT tszPassw( ppro->GetUserStoredPassword());
+ if (tszPassw != NULL)
+ SetDlgItemText(hwndDlg, IDC_PASSWORD, tszPassw);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_URL:
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://www.vk.com");
+ break;
+
+ case IDC_LOGIN:
+ case IDC_PASSWORD:
+ if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ TCHAR str[128];
+ GetDlgItemText(hwndDlg, IDC_LOGIN, str, SIZEOF(str));
+ ppro->setTString("Login", str);
+
+ GetDlgItemText(hwndDlg, IDC_PASSWORD, str, SIZEOF(str));
+ ptrA szRawPasswd( mir_utf8encodeT(str));
+ if (szRawPasswd != NULL) {
+ CallService(MS_DB_CRYPT_ENCODESTRING, strlen(szRawPasswd), szRawPasswd);
+ ppro->setString("Password", szRawPasswd);
+ }
+ }
+ break;
+
+ case WM_CLOSE:
+ EndDialog(hwndDlg, 0);
+ break;
+
+ case WM_DESTROY:
+ Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
+ Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ break;
+ }
+
+ return FALSE;
+}
INT_PTR CVkProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam)
{
|