admin
2024-07-05 3ef188e6075649f4c72e3e7588d8966e1071f2ff
FloatTrade/FloatTradeDlg.cpp
@@ -34,6 +34,9 @@
const int HOT_KEY_CANCEL = 2;
const int HOT_KEY_BUY = 3;
// 可转债消息
#define WM_CB_WINDOW (WM_APP + 1000)
bool CFloatTradeDlg::breakCancelMsg;
@@ -814,6 +817,7 @@
}
void CFloatTradeDlg::OnHotKey(UINT nHotKeyId, UINT nKey, UINT nModifiers) {
   if (!checkTradeQuickKey.GetCheck()) {
@@ -822,8 +826,34 @@
   }
   if (nHotKeyId == HOT_KEY_SELL_ALL) {
      cout << "卖" << endl;
      OnClickedBtnSell();
      list<HWND> hwnds =   Win32Util::searchWindow("可转债交易");
      HWND cbHwnd = 0;
      if (hwnds.size() > 0) {
         for (list<HWND>::iterator e = hwnds.begin(); e != hwnds.end(); ++e) {
            HWND hwnd = *e;
            if (string("可转债交易")._Equal(Win32Util::getWindowName(hwnd))) {
               auto fw = ::GetForegroundWindow();
               if (fw == hwnd) {
                  cbHwnd = hwnd;
               }
               break;
            }
         }
      }
      if (cbHwnd>0) {
         string data = "你是不是傻";
         COPYDATASTRUCT cds;
         cds.dwData = 100; // 可以自定义标识数据
         cds.cbData = (DWORD)data.size() + 1; // 字符串数据长度
         cds.lpData = (PVOID)data.c_str();
         ::SendMessage(cbHwnd, WM_COPYDATA, NULL, (LPARAM)&cds);
      }
      else {
         cout << "卖" << endl;
         OnClickedBtnSell();
      }
   }
   else if (nHotKeyId == HOT_KEY_CANCEL) {
      cout << "撤当前" << endl;