记录下模拟鼠标点击 WebBrowrse 中的网页,以此是根据主窗口的句柄搜索三次 找到 网页的句柄 然后发送鼠标按下和弹起的消息。
LONG x,y; 点击的坐标。
HWND hwnd=主窗口的句柄;
if(hwnd){
hwnd=FindWindowEx(hwnd,0,TEXT("Shell Embedding"),NULL);
if(hwnd){
hwnd=FindWindowEx(hwnd,0,TEXT("Shell DocObject View"),NULL);
if(hwnd){
hwnd=FindWindowEx(hwnd,0,"Internet Explorer_Server",NULL);
if(hwnd){
SendMessage(hwnd, WM_LBUTTONDOWN,0, MAKELPARAM(x,y));
SendMessage(hwnd, WM_LBUTTONUP, 0,MAKELPARAM(x,y));
}
}
}
}