帮我写一段在windows系统上监控指定窗口的python脚本,当有超过10000.00的数字的时候发送窗口抖动
时间: 2024-05-01 12:18:49 浏览: 23
Sure, I can help you with that! Here's the Python script to monitor a specific window on Windows system and detects any number over 10,000.00 and send a window shake:
```
import win32gui
import win32con
def monitor_window():
# Get the handle of the window to monitor
hwnd = win32gui.FindWindow(None, "Window Name")
# Continously loop to monitor the window
while True:
# Get the text of the window
text = win32gui.GetWindowText(hwnd)
# Check if the text contains a number greater than 10,000.00
if '10,000' in text:
# Shake the window by changing its position
win32gui.MoveWindow(hwnd, 0, 0, 800, 600, True)
win32gui.MoveWindow(hwnd, 0, 0, 1024, 768, True)
monitor_window()
```
Note: Remember to replace "Window Name" in line 5 with the name of the window you want to monitor.
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)