且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WinAPI的C ++例如模拟按钮点击与窗口句柄

更新时间:2022-04-11 01:55:51

查找句柄要单击(通过使用 FindWindowEx )的按钮,只要发送点击消息:

Find the handle to the button that you want to click (by using FindWindowEx), and just send click message:

SendMessage(hButton, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(0, 0));
SendMessage(hButton, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(0, 0));