HWND hwnd;
if((hwnd = ::FindWindow(NULL,"temp"))!=0 )
{
//CWnd *pWnd;
char pch[10]="xx";
HWND hwnd1;
hwnd1=::GetWindow(hwnd,GW_CHILD);
while(hwnd1!=NULL)
{
::GetWindowText(hwnd1,pch,10);
if(strcmp(pch,"button1")==0)
{
::SendMessage(hwnd1,WM_ON_BNCLICKED,0,0);
}
::EnableWindow(hwnd1,FALSE);
hwnd1= ::GetWindow(hwnd1,GW_HWNDNEXT);
}
}
else
{
AfxMessageBox("no find",MB_OK);
}
请问::SendMessage(hwnd1,WM_ON_BNCLICKED,0,0);该怎么写,实现的功能是就象鼠标点击temp窗体上的button一样,谢谢
if((hwnd = ::FindWindow(NULL,"temp"))!=0 )
{
//CWnd *pWnd;
char pch[10]="xx";
HWND hwnd1;
hwnd1=::GetWindow(hwnd,GW_CHILD);
while(hwnd1!=NULL)
{
::GetWindowText(hwnd1,pch,10);
if(strcmp(pch,"button1")==0)
{
::SendMessage(hwnd1,WM_ON_BNCLICKED,0,0);
}
::EnableWindow(hwnd1,FALSE);
hwnd1= ::GetWindow(hwnd1,GW_HWNDNEXT);
}
}
else
{
AfxMessageBox("no find",MB_OK);
}
请问::SendMessage(hwnd1,WM_ON_BNCLICKED,0,0);该怎么写,实现的功能是就象鼠标点击temp窗体上的button一样,谢谢
解决方案 »
- 第三方软件异常退出,如何定位原因?
- RegisterHotKey()和UnRegisterHotKey()调用次数问题
- 防止屏幕刷新双缓冲问题?在线等急
- 如何实现对JTAG口的控制(SOS)
- 怪、怪、怪,为什么树控件有时候水平滚动条无比长?
- 为什么我的单文档MFC程序不响应ON_PAINT消息???急!!!!
- "- pure virtual function call"错误,帮我找找这个函数在那好吗?我找不到!
- 模式对话框中添加的“static text”控件的字体大小如何改变?
- 在MDI中,有两个菜单,一个是没有新文挡打开的时候,一个是有
- 谁能解决在WIN9X下,scroll size在大于16位数的情况下,scroll bar仍然在拖动时准确定位
- ADO远程连接问题(急)
- 请问一下在SDI中如何添加控件?
(WPARAM)MAKEWPARAM( nButtonID, BN_CLICKED ), (LPARAM)hButtonWnd );nButtonID 可用 GetWindowLong( hButtonWnd, GWL_ID ) 获取。