| | |
| | | cancel_trade_win = cls.getCancelBuyWin() |
| | | if cancel_trade_win <= 0: |
| | | raise Exception("委托撤销窗口未打开") |
| | | else: |
| | | pos = win32gui.GetWindowRect(cancel_trade_win) |
| | | width = pos[2] - pos[0] |
| | | height = pos[3] - pos[1] |
| | | if width <= 0 or height <= 0: |
| | | raise Exception("委托撤销窗口被最小化") |
| | | |
| | | @classmethod |
| | | def getText(cls, hwnd): |
| | |
| | | logger_trade_gui.info("开始撤单:code-{}".format(code)) |
| | | win = self.cancel_win |
| | | if win <= 0: |
| | | raise Exception("无法找到取消委托窗口") |
| | | self.cancel_win = self.getCancelBuyWin() |
| | | win = self.cancel_win |
| | | if win <= 0: |
| | | raise Exception("无法找到取消委托窗口") |
| | | t = time.time() |
| | | print(t) |
| | | start = int(round(t * 1000)) |