diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-03-18 08:39:23 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-03-18 08:39:23 +0000 |
commit | a1728bef4efb06742b792f9f5b4aab48d1d7bb48 (patch) | |
tree | 43bb17c0b27f92d47a831cab62a01861b660ac2e /protocols/VKontakte/src/vk_captcha.cpp | |
parent | c00fd13ea14bdafd1d18c19fef9df9b3907130a4 (diff) |
VKontakte:
add ‘Open in browser’ button to captcha form
add hidden option ‘AlwaysOpenCaptchaInBrowser’ (BYTE)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16495 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_captcha.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_captcha.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp index f3b6137082..9e7913443d 100644 --- a/protocols/VKontakte/src/vk_captcha.cpp +++ b/protocols/VKontakte/src/vk_captcha.cpp @@ -26,6 +26,7 @@ struct CAPTCHA_FORM_PARAMS HBITMAP bmp;
int w,h;
char Result[100];
+ CVkProto* proto;
};
static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -70,6 +71,9 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam DeleteDC(hdcMem);
EndPaint(hwndDlg, &ps);
+
+ if (params->proto->getBool("AlwaysOpenCaptchaInBrowser", false))
+ params->proto->ShowCaptchaInBrowser(params->bmp);
}
break;
@@ -78,6 +82,10 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam case IDCANCEL:
EndDialog(hwndDlg, 0);
return TRUE;
+
+ case IDOPENBROWSER:
+ params->proto->ShowCaptchaInBrowser(params->bmp);
+ break;
case IDOK:
GetDlgItemTextA(hwndDlg, IDC_VALUE, params->Result, _countof(params->Result));
@@ -125,10 +133,11 @@ bool CVkProto::RunCaptchaForm(LPCSTR szUrl, CMStringA &result) memio.fif = FIF_UNKNOWN; /* detect */
param.bmp = (HBITMAP)CallService(MS_IMG_LOADFROMMEM, (WPARAM)&memio);
- BITMAP bmp = {0};
+ BITMAP bmp = { 0 };
GetObject(param.bmp, sizeof(bmp), &bmp);
param.w = bmp.bmWidth;
param.h = bmp.bmHeight;
+ param.proto = this;
int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, CaptchaFormDlgProc, (LPARAM)¶m);
if (res == 0)
return false;
|