解决方案 »
- 想做软件界面开发,类似360,QQ那样的界面,哪里有资料?
- 请各位给点思路与建议!!!!急!!!!
- 请教ListControl
- delphi编写的一个dll,里面有一个回调函数,如何使用vc调用?急用啊,谢谢
- 请问各位MYSQL是网络数据库吗?为什么在连接字符串中server写localhost或者127.0.0.1可以实现连接,而写199.99.99.97(本机IP)不能实现
- DVD刻录机只能刻CD是怎么回事?
- 学习html/xml 看什么书比较好?
- 我需要实现这个接口吗?
- 我要在2000下写采集卡的中断程序,可否帮帮忙?在线等待!急啊!
- 哪个兄弟有取得网络利用率的例子或者方法,类似任务管理器里面的?
- 有关重叠方式串口通信的疑问?
- 问问
m_EditBox1=_T("11111");
void CRTSTestDlg::OnBnClickedButton6()
{
HWND hwnd = ::FindWindow("TXGuiFoundation","查找联系人/群/企业");
if(hwnd)
{
hwnd = GetChildWindow(hwnd,2);
if (hwnd)
{
int ii = 0;
::PostMessage(hwnd,WM_PASTE,0,0);
}
}}/************************************************************************/
HWND CRTSTestDlg::GetChildWindow(HWND hwnd,int iIndex)
{
HWND hwndChind = NULL;
CString strTemp = "";
int i = 1;
hwndChind = ::GetWindow(hwnd,GW_CHILD);
CWnd *pWnd = CWnd::FromHandle(hwndChind);
while (pWnd)
{
hwndChind = pWnd->GetSafeHwnd();
if (i == iIndex)
{
return hwndChind;
}
pWnd = pWnd->GetNextWindow(GW_HWNDNEXT);
i++;
}
return hwndChind;
}这段代码能将你剪贴板中的内容填写到你要的目标窗口中
--------------------Configuration: RTSTest - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
RTSTest.cpp
RTSTestDlg.cpp
D:\RTSTest\RTSTestDlg.cpp(174) : error C2039: 'GetChildWindow' : is not a member of 'CRTSTestDlg'
d:\rtstest\rtstestdlg.h(14) : see declaration of 'CRTSTestDlg'
Generating Code...
Error executing cl.exe.RTSTest.exe - 1 error(s), 0 warning(s)
提于这个,哥哥
--------------------Configuration: RTSTest - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
RTSTest.cpp
RTSTestDlg.cpp
D:\RTSTest\RTSTestDlg.cpp(174) : error C2039: 'GetChildWindow' : is not a member of 'CRTSTestDlg'
d:\rtstest\rtstestdlg.h(14) : see declaration of 'CRTSTestDlg'
Generating Code...
Error executing cl.exe.RTSTest.exe - 1 error(s), 0 warning(s)GetChildWindow这个函数是我自己定义的一个函数,你需要按照成员函数的正常定义流程来做啊,这里体现的是没有在头文件中添加声明。
#include "stdafx.h"
#include <windowS.h>
HWND GetChildWindow(HWND hwnd,int iIndex)
{
HWND hwndChind = NULL;
int i = 1;
hwndChind = ::GetWindow(hwnd,GW_CHILD);
while (hwndChind)
{
if (i == iIndex)
{
return hwndChind;
}
hwndChind = ::GetNextWindow(hwndChind,GW_HWNDNEXT);
i++;
}
return hwndChind;
}
int _tmain(int argc, _TCHAR* argv[])
{
HWND hwnd = ::FindWindow("TXGuiFoundation","查找联系人/群/企业");
if(hwnd)
{
hwnd = GetChildWindow(hwnd,2);
if (hwnd)
{
int ii = 0;
::PostMessage(hwnd,WM_PASTE,0,0);//发送此消息前将你要填写的内容写入到剪帖板
}
}
getchar();
return 0;
}一个控制台程序,再不行就帮不到你了