小编use*_*682的帖子

C#如何使用WM_GETTEXT/GetWindowText API

我想获得应用程序的控件/句柄的内容..

这是实验代码..

 Process[] processes = Process.GetProcessesByName("Notepad");
        foreach (Process p in processes)
        {
            StringBuilder sb = new StringBuilder();
            IntPtr pFoundWindow = p.MainWindowHandle;
             List <IntPtr> s =    GetChildWindows(pFoundWindow); 
            // function that returns a 
            //list of handle from child component on a given application.

             foreach (IntPtr test in s)
             {
              // Now I want something here that will return/show 
               the text on the notepad..


             }


            GetWindowText(pFoundWindow, sb,256);
            MessageBox.Show(sb.ToString()); // this shows the title.. no problem with that

        } 
Run Code Online (Sandbox Code Playgroud)

任何的想法?我已经阅读了一些API方法,如GetWindowText或WM_GETTEXT,但我不知道如何使用它或将其应用于我的代码..我需要一个教程或示例代码...

提前致谢 : )

c# api

15
推荐指数
1
解决办法
4万
查看次数

C#从另一个独立应用程序获取数据?

我如何让我的c#程序从另一个应用程序获取数据?

假设应用程序是,例如,"雅虎信使",有人在聊天框上对你说"你好"...

现在,我希望我的c#程序从我的应用程序中打印出来的"Yahoo Messenger聊天框"中读取/获取该数据或信息?可能吗?

c# exe

5
推荐指数
1
解决办法
1万
查看次数

c#如何以文本形式阅读网站内容?

如何获取网站的内容?

我正在谈论的网站只是一个简单的页面,上面没有任何其他链接:

以此为例:http://introcs.cs.princeton.edu/java/23recursion/Queens.java.html

我只想阅读内容并将其保存在字符串中,以便稍后我可以轻松操作它.

任何的想法?还是教程?

提前致谢 : )

c#

0
推荐指数
1
解决办法
141
查看次数

标签 统计

c# ×3

api ×1

exe ×1