C# 在使用FindWindowEx的参数使用详解
来源:互联网 发布:东方财富mac 编辑:程序博客网 时间:2024/06/13 22:04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
using
System.Runtime .InteropServices ;
namespace
WindowsApplication128
{
public
partial
class
Form1 : Form
{
[DllImport(
"user32.dll"
)]
static
extern
int
GetClassName(IntPtr Handle, [Out] StringBuilder ClassName,
int
MaxCount);
[DllImport(
"user32.dll"
)]
static
extern
int
SendMessage(IntPtr Handle,
int
WParam,
int
LParam);
[DllImport(
"user32.dll"
)]
static
extern
IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter,
string
lpszClass,
string
lpszWindow);
Button B =
new
Button();
public
Form1()
{
InitializeComponent();
B.Parent =
this
;
B.Click +=
new
EventHandler(B_Click);
this
.Shown +=
new
EventHandler(Form1_Shown);
}
private
void
B_Click(
object
sender, EventArgs e)
{
MessageBox.Show(
"!!!"
);
}
void
Form1_Shown(
object
sender, EventArgs e)
{
int
WM_CLICK = 0x00F5;
StringBuilder ClassName =
new
StringBuilder(256);
GetClassName(B.Handle, ClassName, ClassName.Capacity);
IntPtr Handle = FindWindowEx(
this
.Handle, IntPtr.Zero, ClassName.ToString(), String.Empty);
SendMessage(Handle, WM_CLICK, 0);
}
}
}
0 0
- C# 在使用FindWindowEx的参数使用详解
- C#FindWindowEx参数详解
- 在C#函数的参数使用valuetype
- FindWindow, FindWindowEx, SendMessage, SetForegroundWindow 使用
- 自动化测试中FindWindow与FindWindowEx的使用示例
- C#中参数的使用
- C#中参数的使用
- C#命名参数的使用
- 自动化测试中FindWindow与FindWindowEx的使用为输入框赋值示例
- 使用FindWindow和FindWindowEx给指定窗口的子控件发消息
- 自动化测试中FindWindow与FindWindowEx的使用为输入框赋值示例
- C# FindWindowEx用法
- c# ref参数使用
- C#使用参数数组
- C# 可变数量参数的使用
- C# 中 params 的使用 可变参数
- C# 输出参数的使用例子
- C# ref和out参数的使用
- JavaScript的回调问题
- php面试题及答案
- DirectX开发中找不到dxtrans.h的问题的解决
- 关于SEL的一些总结
- 剑指offer(36):第一个只出现一次的字符
- C# 在使用FindWindowEx的参数使用详解
- OTA2-android 升级基本原理
- com.MySQL.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own ali
- C#设计模式--工厂方法
- Android JNI配置及入门
- iOS 最新AppStore审核指南
- 关于android中alarm的使用
- pageContext对象
- Android 视图组件的自定义