点击开一个QQ群.里面有个发信息的.输入内容的那个控件的句柄怎么这难找?登陆按钮的句柄我都找到了.就差那个输入文本框的句柄了 int nTime = 75;
string search="广告/设计类招聘群 - 群";
int QunWnd = 0;
int currentHandle = 0;
//找QQ登陆句柄
while (nTime-- > 0)
{
QunWnd= FindWindow("#32770",search);
if (QunWnd != 0)
{
break;
}
System.Threading.Thread.Sleep(50);
}
if (QunWnd == 0)
{
MessageBox.Show("窗体没有没找到,请重试");
return;
}
//找QQ群输入文本框
currentHandle = DelayFindWindowEx(QunWnd,0,"#32770","");
if (currentHandle != 0)
{
currentHandle = DelayFindWindowEx(currentHandle,0,"RICHEDIT","");//密码
if (currentHandle != 0)
{
string say ="大家好";
SendMessage(currentHandle, WM_SETTEXT, 0,say);
}
}
string search="广告/设计类招聘群 - 群";
int QunWnd = 0;
int currentHandle = 0;
//找QQ登陆句柄
while (nTime-- > 0)
{
QunWnd= FindWindow("#32770",search);
if (QunWnd != 0)
{
break;
}
System.Threading.Thread.Sleep(50);
}
if (QunWnd == 0)
{
MessageBox.Show("窗体没有没找到,请重试");
return;
}
//找QQ群输入文本框
currentHandle = DelayFindWindowEx(QunWnd,0,"#32770","");
if (currentHandle != 0)
{
currentHandle = DelayFindWindowEx(currentHandle,0,"RICHEDIT","");//密码
if (currentHandle != 0)
{
string say ="大家好";
SendMessage(currentHandle, WM_SETTEXT, 0,say);
}
}
解决方案 »
- 异步读http数据时候发生的一个问题
- 谁做过医保接口的请进贴
- 如何判断C#字符串里中文字符有几个?
- VS2005帮助检测更新
- 大家显示数据列表一般用什么方法?
- 读取XML问题
- 问题:关于在web form中调用win form控件
- 在C#里怎么样将一个二进制文件存到数据库里,然后再取出来?
- 一个简单问题。大家帮帮我。
- DrawString(string s, Font font, Brush brush, float x, float y); 坐标单位是像素吗
- 怎样在WindowsXP中获得cpu利用率和可用内存情况
- 在C#的winform程序中, 鼠标如果10s钟以上就自动调用一个函数,或弹出个对话框, 请问这要怎么实现啊??
欢迎大家在此讨论关于.net的各种技术。
求.怎么遍历该afxWnd42下的子窗体?
欢迎大家在此讨论关于.net的各种技术。1号群
我做过QQ尾程序的一部份
SendMessage(hdo,EM_SETSEL,-1,-1);//hdo-Handle of richtext,move to the end of richtext
StringBuilder sb=new StringBuilder(256);
sb.Append("your text to append");
SendMessage(hdo,EM_REPLACESEL,0,sb);