WeChat Messenger v2.0
Quick Start
python scripts/send.py "contact_name" "your message"
Example:
python scripts/send.py "枫林" "你好"
Target speed: < 3s. Zero screenshots, zero OCR, zero external EXEs.
How It Works
Single Python script, direct Win32 API:
win32gui.EnumWindows→ find WeChat windowSetForegroundWindow→ activateGetWindowRect→ get coordinatesSetCursorPos+mouse_event→ click search boxSendInput(Ctrl+A, Ctrl+V, Enter) → type contact- Sleep 0.8s → wait for chat pane
- Click input box → paste message → Enter
Speed: v1.0 vs v2.0
| v1.0 (screen_util.exe) | v2.0 (Win32 API) | |
|---|---|---|
| External calls | ~10 | 0 |
| Screenshots | 3 | 0 |
| Total time | ~20s | ~2s |
Prerequisites
- WeChat PC running + logged in
pip install pywin32 pyperclip
Credits
v1.0: GUI automation via screen_util.exe (screenshot + OCR + coordinate click) v2.0: Dawn rewrote with direct Win32 API — 10x faster. 致敬 screen_util.exe 原始作者.
