admin
2022-09-30 1a16b19acb23a4f28bafd01f3ed80fb225a96c3e
ConsoleApplication/THSActionUtil.cpp
@@ -541,6 +541,7 @@
   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) {
@@ -1457,6 +1458,67 @@
   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);