模拟程序点击的问题:调用的程序只有一个panel 灰太狼你是用mouse_event实现的还是? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我使用mouse_event遇到的问题是 运行点击按钮代码后鼠标停留在按钮上 但是没有点击的效果 只是鼠标位置对了 BOOL ActiveSudaExplorer(CString& strParam){// printf("ActiveSudaExplorer start \n"); RECT rect;// CString strTitle("2345网址导航-我的个性化主页-中国最好的网址站 - 速达浏览器"); CString strTitle("http://www.suda123.com/sucess.asp?uid=djwillis&snn=d... - 速达浏览器"); CString strChangedTitle; HWND hSudaHwnd = ::FindWindow(NULL, strTitle.GetBuffer(0)); if (hSudaHwnd) { printf("速达浏览器\n"); //查找Internet Explorer Service DWORD Width = GetSystemMetrics(SM_CXSCREEN); DWORD Heigth = GetSystemMetrics(SM_CYSCREEN); MoveWindow(hSudaHwnd, 0, 0, Width, Heigth, TRUE); GetSudaExplorerHwnd(hSudaHwnd, NULL); if (g_hSudaIEServiceHwnd) { printf("找到速达浏览器IEService\n"); ::GetWindowRect(g_hSudaIEServiceHwnd, &rect); CRect IERect(&rect);// for(int i = IERect.top + IERect.bottom/2; i < IERect.bottom; i+=20)// { DWORD X = IERect.left + IERect.right/2; DWORD Y = 135; for(int j = X; j < IERect.right; j+=5) { LPARAM lparam=(Y<<16)+j; //printf("x = %d y = %d lparam = %d \n", j, Y, lparam); ::PostMessage(g_hSudaIEServiceHwnd, WM_LBUTTONDOWN, MK_LBUTTON, lparam); ::PostMessage(g_hSudaIEServiceHwnd, WM_LBUTTONUP, MK_LBUTTON, lparam); Sleep(1000); ::GetWindowText(hSudaHwnd, strChangedTitle.GetBuffer(128), 128); if (strTitle.Compare(strChangedTitle) != 0) { SendCountDataToServer(strParam); printf("已经激活浏览器"); //goto SUCCESSFULLY; break; } }// }//SUCCESSFULLY:// ; } ::SendMessage(hSudaHwnd, WM_CLOSE, 0, 0); } else { printf("没有找到句柄 \n"); } printf("ActiveSudaExplorer end \n"); return TRUE;} 你不是能取得对话框的句柄吗?然后MoveWindow不行吗? GDI 对象的删除 望指教 有没有vc MFC数据库ADO增删查改的例子 《算法之道》里的一个问题 关于避免使用全局变量的方法,怎样利用结构体 ? 求助:一些基本问题,但找不到答案 自己写SOCKET程序发送电子邮件,使用UTF-8、gb2312编码邮件内容在outlook或者 Foxmail中都正常显示。 救急:socket通信的怪问题,大虾们怎么办。。。。 我想在VC中定义中文名的变量 怎样调试在ASP中使用的COM? 求,RSA加密解密算法。 模拟程序点击的问题:调用的程序只有一个panel 编译后内存的布局是否固定?如何固定?
{//
printf("ActiveSudaExplorer start \n");
RECT rect;
// CString strTitle("2345网址导航-我的个性化主页-中国最好的网址站 - 速达浏览器");
CString strTitle("http://www.suda123.com/sucess.asp?uid=djwillis&snn=d... - 速达浏览器");
CString strChangedTitle;
HWND hSudaHwnd = ::FindWindow(NULL, strTitle.GetBuffer(0));
if (hSudaHwnd)
{
printf("速达浏览器\n");
//查找Internet Explorer Service
DWORD Width = GetSystemMetrics(SM_CXSCREEN);
DWORD Heigth = GetSystemMetrics(SM_CYSCREEN);
MoveWindow(hSudaHwnd, 0, 0, Width, Heigth, TRUE); GetSudaExplorerHwnd(hSudaHwnd, NULL);
if (g_hSudaIEServiceHwnd)
{
printf("找到速达浏览器IEService\n"); ::GetWindowRect(g_hSudaIEServiceHwnd, &rect);
CRect IERect(&rect);
// for(int i = IERect.top + IERect.bottom/2; i < IERect.bottom; i+=20)
// {
DWORD X = IERect.left + IERect.right/2;
DWORD Y = 135;
for(int j = X; j < IERect.right; j+=5)
{
LPARAM lparam=(Y<<16)+j;
//printf("x = %d y = %d lparam = %d \n", j, Y, lparam);
::PostMessage(g_hSudaIEServiceHwnd, WM_LBUTTONDOWN, MK_LBUTTON, lparam);
::PostMessage(g_hSudaIEServiceHwnd, WM_LBUTTONUP, MK_LBUTTON, lparam);
Sleep(1000);
::GetWindowText(hSudaHwnd, strChangedTitle.GetBuffer(128), 128);
if (strTitle.Compare(strChangedTitle) != 0)
{
SendCountDataToServer(strParam);
printf("已经激活浏览器");
//goto SUCCESSFULLY;
break;
}
}
// }
//SUCCESSFULLY:
// ;
} ::SendMessage(hSudaHwnd, WM_CLOSE, 0, 0);
}
else
{
printf("没有找到句柄 \n");
}
printf("ActiveSudaExplorer end \n");
return TRUE;
}
然后MoveWindow不行吗?