窗口捕获问题,简单!送分啦!!!

davidlovelife 2011-08-08 03:46:08

我要获得第二个子窗口的句柄,请问如何解决??
送分啦!!
...全文
83 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
a4974 2011-08-08
  • 打赏
  • 举报
回复
看不懂。。。
lazyleland 2011-08-08
  • 打赏
  • 举报
回复
大哥,你提问题要描述清楚点好不。

[Quote=引用 11 楼 davidlovelife 的回复:]

引用 10 楼 lazyleland 的回复:
或用这个吧。


C# code
int index = 0;
for (int i = 0; i < this.Controls.Count; i++)
{
if (this.Controls[i] is Form)
{
index++;
if (index == 2)
……
[/Quote]
davidlovelife 2011-08-08
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 lazyleland 的回复:]
或用这个吧。


C# code
int index = 0;
for (int i = 0; i < this.Controls.Count; i++)
{
if (this.Controls[i] is Form)
{
index++;
if (index == 2)
return this.Cont……
[/Quote]我获取的是别人的一个程序窗口下的里面的子窗口,你这个恐怕不行啊..
lazyleland 2011-08-08
  • 打赏
  • 举报
回复
或用这个吧。

int index = 0;
for (int i = 0; i < this.Controls.Count; i++)
{
if (this.Controls[i] is Form)
{
index++;
if (index == 2)
return this.Controls[i].Handle;
}
}


[Quote=引用 9 楼 davidlovelife 的回复:]

引用 7 楼 lazyleland 的回复:
Application.OpenForms[1].Handle
针对我的情况,能给个简单的例子么?大哥?
[/Quote]
davidlovelife 2011-08-08
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 lazyleland 的回复:]
Application.OpenForms[1].Handle
[/Quote]针对我的情况,能给个简单的例子么?大哥?
davidlovelife 2011-08-08
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 wangyong0921 的回复:]
引用 5 楼 davidlovelife 的回复:

引用 3 楼 woshiliourun 的回复:
没图片···呵呵 友情帮顶··
图片显示不出,补充下:
结构如下:
------""SplitterBar
+""StandardWindow
+""StandardWindow

两个子窗口标题都为空,类名都相同!
我要获得第二个子窗口的句柄,请问如何解决??


……
[/Quote]没有name属性噢。。
lazyleland 2011-08-08
  • 打赏
  • 举报
回复
Application.OpenForms[1].Handle
Just4life 2011-08-08
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 davidlovelife 的回复:]

引用 3 楼 woshiliourun 的回复:
没图片···呵呵 友情帮顶··
图片显示不出,补充下:
结构如下:
------""SplitterBar
+""StandardWindow
+""StandardWindow

两个子窗口标题都为空,类名都相同!
我要获得第二个子窗口的句柄,请问如何解决??
[/Quote]

那窗口的Name属性是否不一样?如果不一样可以使用UIAtuomation类来获取
davidlovelife 2011-08-08
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 woshiliourun 的回复:]
没图片···呵呵 友情帮顶··
[/Quote]图片显示不出,补充下:
结构如下:
------""SplitterBar
+""StandardWindow
+""StandardWindow

两个子窗口标题都为空,类名都相同!
我要获得第二个子窗口的句柄,请问如何解决??
davidlovelife 2011-08-08
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 happy09li 的回复:]
看不懂。。。
[/Quote]图片显示不出,补充下:
结构如下:
------""SplitterBar
+""StandardWindow
+""StandardWindow

两个子窗口标题都为空,类名都相同!
我要获得第二个子窗口的句柄,请问如何解决??
woshiliourun 2011-08-08
  • 打赏
  • 举报
回复
没图片···呵呵 友情帮顶··
熙风 2011-08-08
  • 打赏
  • 举报
回复
看不懂。。。
davidlovelife 2011-08-08
  • 打赏
  • 举报
回复
图片显示不出,补充下:
结构如下:
------""SplitterBar
+""StandardWindow
+""StandardWindow

两个子窗口标题都为空,类名都相同!
我要获得第二个子窗口的句柄,请问如何解决??
送分啦!!

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧