Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用user32.dll自动化某些事情或任何其他方式_C#_Automation_User32 - Fatal编程技术网

C# 使用user32.dll自动化某些事情或任何其他方式

C# 使用user32.dll自动化某些事情或任何其他方式,c#,automation,user32,C#,Automation,User32,我最近尝试了这两个功能: [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName,string lpWindowName); [DllImport("user32.dll")] public static extern IntPtr FindWindowEx(int hwndParent,int hwndChildAfter,String lpszClass, String lpsz

我最近尝试了这两个功能:

[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName,string lpWindowName);

[DllImport("user32.dll")]
public static extern IntPtr FindWindowEx(int hwndParent,int hwndChildAfter,String lpszClass, String lpszWindow);
…到目前为止,我只收到了
IntPtr
s,我知道(至少我认为)返回的
int
是窗口的进程ID,现在我想获取窗口的控件文本并单击按钮,怎么做?
我在……周围找不到任何东西。

我真的觉得这些东西很难。。。如果你不想学习winapi,也许你可以检查这些或者使用UI自动化库。Project White非常流行,.NET System.Windows.Automation命名空间也非常流行。