代码拉取完成,页面将自动刷新
同步操作将从 daemon_process/EasyCKL 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "EcPackApi.h"
CKLEXPORT void WINAPI EcPkHtmlRefreshContentJumpUrl(SimpleHandler* handler, wchar_t* url, wchar_t* referer) {
if (!std::wstring(url).substr(0, 6).compare(L"chrome")) return;
std::wstring html = L"<html><head><meta http-equiv=\"refresh\" content=\"0;url=" + std::wstring(url) + L"\"></head><body bgcolor=\"white\"></body></html>";
Chrome_LoadString(handler, (wchar_t*)html.c_str(), referer);
}
CKLEXPORT void* WINAPI EcPkCreateJSRefererBrowserSync(DWORD id, HWND hParent, RECT* rect, wchar_t* url, wchar_t* referer, LPBROWSER_CALLBACKS callbacks) {
void* browser = Chrome_CreateChildBrowser(BROWSERFLAG_SYNC, callbacks, id, NULL, L":", hParent, rect, 0);
if (browser) {
if (referer) {
std::wstring html = L"<html><head><meta http-equiv=\"refresh\" content=\"0;url=" + std::wstring(url) + L"\"></head><body bgcolor=\"white\"></body></html>";
Chrome_LoadString((SimpleHandler *)browser, (wchar_t*)html.c_str(), referer);
}
else Chrome_LoadUrl((SimpleHandler *)browser, url);
}
return browser;
}
CKLEXPORT void WINAPI EcPkDisableDragDrop(SimpleHandler* handler) {
#ifdef _WIN32
HWND hBrowserWindow = Chrome_GetWindowHandle(handler);
if (hBrowserWindow) {
HWND hWndHostChild = GetWindow(hBrowserWindow, GW_CHILD);
HMODULE hModule = LoadLibraryW(L"ole32.dll");
if (hModule) {
typedef int (WINAPI * RevokeDragDrop_t)(HWND hWnd);
RevokeDragDrop_t RevokeDragDrop = (RevokeDragDrop_t)GetProcAddress(hModule, "RevokeDragDrop");
if (RevokeDragDrop)
RevokeDragDrop(hWndHostChild);
//#include <Ole2.h>
//#pragma comment(lib, "ole32.lib")
//RevokeDragDrop(hWndHostChild);
}
}
#elif defined __linux__
//Not support linux!
#endif
}
CKLEXPORT void WINAPI EcPkJavaScriptSetValueByObjectId(SimpleHandler* handler, wchar_t* id, wchar_t* value) {
std::wstring js = L"document.getElementById('" + std::wstring(id) + L"').value='" + value + L"'";
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptSetValueByObjectName(SimpleHandler* handler, wchar_t* name, wchar_t* value) {
std::wstring js = L"document." + std::wstring(name) + L".value='" + value + L"'";
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptSubmitByFormId(SimpleHandler* handler, wchar_t* id) {
std::wstring js = L"document.getElementById('" + std::wstring(id) + L"').submit()";
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptSubmitByFormName(SimpleHandler* handler, wchar_t* name) {
std::wstring js = L"document." + std::wstring(name) + L".submit()";
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptSetCheckedByObjectId(SimpleHandler* handler, wchar_t* id, bool checked) {
std::wstring js = L"document.getElementById('" + std::wstring(id) + L"').checked=" + (checked ? L"true" : L"false");
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptSetCheckedByObjectName(SimpleHandler* handler, wchar_t* name, bool checked) {
std::wstring js = L"document." + std::wstring(name) + L".checked=" + (checked ? L"true" : L"false");
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptClickButtonByObjectId(SimpleHandler* handler, wchar_t* id) {
std::wstring js = L"document.getElementById('" + std::wstring(id) + L"').click()";
Chrome_ExecJS(handler, js.c_str());
}
CKLEXPORT void WINAPI EcPkJavaScriptClickButtonByObjectName(SimpleHandler* handler, wchar_t* name) {
std::wstring js = L"document." + std::wstring(name) + L".click()";
Chrome_ExecJS(handler, js.c_str());
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。