| | |
| | | std::list<int*> dataItemList; |
| | | |
| | | for (int i = start_row;i < end_row;i++) { |
| | | //TODO 100 |
| | | bool empty = ImgDivider::isRowEmpty(img, i, start_col, start_col + 50, 1, _IMG_BINARY_THRESHOLD) && ImgDivider::isRowEmpty(img, i, start_col + 50, start_col + 150, 2, _IMG_BINARY_THRESHOLD) && ImgDivider::isRowEmpty(img, i, start_col + (end_col - start_col) / 2 - 40, start_col + (end_col - start_col) / 2 + 40, 1, _IMG_BINARY_THRESHOLD); |
| | | if (empty) { |
| | | if (emptyStartRow < 0) { |
| | |
| | | } |
| | | } |
| | | |
| | | if (contentStartRow < 0|| contentStartRow>rows-100) { |
| | | if (contentStartRow < 0 || contentStartRow>rows - 100) { |
| | | throw string("起始行分隔出错(18)"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | contentEndRow = contentStartRow + 50; |
| | | |
| | | |
| | | //分隔列 |
| | | list<int*> dataColIndexs; |
| | | int startf = -1; |
| | |
| | | } |
| | | |
| | | Sleep(200); |
| | | addDialog = FindWindowExA(addDialog, NULL,"AfxWnd100s","CEFBrowser" ); |
| | | addDialog = FindWindowExA(addDialog, NULL, "AfxWnd100s", "CEFBrowser"); |
| | | addDialog = FindWindowExA(addDialog, NULL, "CefBrowserWindow", NULL); |
| | | addDialog = FindWindowExA(addDialog, NULL, "Chrome_WidgetWin_0", NULL); |
| | | addDialog = FindWindowExA(addDialog, NULL, "Chrome_RenderWidgetHostHWND", NULL); |
| | | cout << "添加股票弹框:"<< addDialog << endl; |
| | | cout << "添加股票弹框:" << addDialog << endl; |
| | | |
| | | |
| | | Win32Util::focus(addDialog); |
| | |
| | | lastBar = bar; |
| | | } |
| | | bar = FindWindowEx(hwnd, bar, TEXT("msctls_statusbar32"), NULL); |
| | | if (count > 10|| bar<=0) { |
| | | if (count > 10 || bar <= 0) { |
| | | bar = 0; |
| | | break; |
| | | } |
| | |
| | | |
| | | bool THSActionUtil::thsIsDead() |
| | | { |
| | | cv::Mat oldMat= getTHSTimeCapture(); |
| | | cv::Mat oldMat = getTHSTimeCapture(); |
| | | Sleep(1200); |
| | | cv::Mat newMat = getTHSTimeCapture(); |
| | | |
| | |
| | | |
| | | return FALSE; |
| | | } |
| | | void THSActionUtil::updateMainSite() |
| | | { |
| | | //获取主页 |
| | | HWND main = getMainWin(); |
| | | if (main <= 0) { |
| | | throw string("同花顺主页未打开"); |
| | | } |
| | | Win32Util::showWindow(main); |
| | | //获取toolbar |
| | | HWND win = NULL; |
| | | do { |
| | | win = FindWindowExA(main, win, "AfxControlBar100s", ""); |
| | | if (win <= 0) { |
| | | break; |
| | | } |
| | | |
| | | RECT rect; |
| | | GetWindowRect(win, &rect); |
| | | if (rect.bottom - rect.top >= 40 && rect.bottom - rect.top <= 60) { |
| | | break; |
| | | } |
| | | } while (true); |
| | | |
| | | if (win <= 0) { |
| | | throw string("测速按钮未找到"); |
| | | } |
| | | |
| | | win = FindWindowExA(win, NULL, "#32770", ""); |
| | | if (win <= 0) { |
| | | throw string("测速按钮未找到"); |
| | | } |
| | | |
| | | HWND btn = GetDlgItem(win, 0x00007A17); |
| | | if (btn <= 0) { |
| | | throw string("测速按钮未找到"); |
| | | } |
| | | |
| | | //点击按钮 |
| | | Win32Util::visualClick(btn, MAKELONG(3,3)); |
| | | for (int i = 0;i < 10;i++) { |
| | | list<HWND> _list = Win32Util::searchWindow("选择最优行情主站"); |
| | | if (_list.size() > 0) { |
| | | HWND win = *(_list.begin()); |
| | | HWND loginBtn = 0; |
| | | for (int j = 0;j < 10;j++) |
| | | { |
| | | loginBtn = FindWindowExA(win, NULL, "Button", "登 录"); |
| | | if (loginBtn > 0) { |
| | | //点击登录按钮 |
| | | Win32Util::visualClick(loginBtn, MAKELONG(2, 2)); |
| | | break; |
| | | } |
| | | Sleep(200); |
| | | } |
| | | } |
| | | Sleep(400); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | void THSActionUtil::clearPlateCodes(HWND hwnd) |
| | | { |
| | | HWND content = FindWindowExA(hwnd, NULL, "AfxFrameOrView100s", NULL); |