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命名空间也非常流行。