我觉得你用GetWindowText就可以做到啊取值啊.

解决方案 »

  1.   

    http://dev.csdn.net/develop/article/37/37848.shtm
    应该一样的道理
      

  2.   

    http://dev.csdn.net/develop/article/53/53147.shtm-----------------------------假如对textbox控件加密了你该怎么办 ?
    除非你能锁定程序的textbox控件,要不就只能获得键盘信息 !
      

  3.   

    你是想截取键盘输入吧
    参考一下http://dev.csdn.net/develop/article/53/53147.shtm
      

  4.   

    鼠标钩子:
    http://dev.csdn.net/develop/article/41/41301.shtm
    参考函数:
    那就用Hook了,参考如下的函数:
    //装置钩子的函数
    [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
    public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);//卸下钩子的函数(已用C#语法修改过,可以直接用)
    [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
    public static extern bool UnhookWindowsHookEx(int idHook);[DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
    public static extern int CallNextHookEx(int idHook, int nCode, Int32 wParam, IntPtr lParam);  [DllImport("user32")] 
    public static extern int GetKeyboardState(byte[] pbKeyState);public delegate int HookProc(int nCode, Int32 wParam, IntPtr lParam);
      

  5.   

    http://blog.joycode.com/mvm/archive/2004/10/18/35790.aspx
    这个应该够参考吧
      

  6.   

    using System.Reflection;[DllImport("user32.dll", EntryPoint="FindWindow")]
    public static extern int FindWindow (
    string lpClassName,
    string lpWindowName
    );[DllImport("user32.dll", EntryPoint="FindWindowEx")]
    public static extern int FindWindowEx (
    int hWnd1,
    int hWnd2,
    string lpsz1,
    string lpsz2
    );[DllImport("user32.dll", EntryPoint="SendMessage")]
    public static extern int SendMessage (
    int hwnd,
    int wMsg,
    int wParam,
    System.Text.StringBuilder lParam
    );private void button1_Click(object sender, System.EventArgs e)
    {
    int hwnd = FindWindow("notepad", null);
    hwnd = FindWindowEx(hwnd, 0, "Edit", null);
    System.Text.StringBuilder str = new System.Text.StringBuilder(255);
    SendMessage(hwnd, 0xD, str.Capacity, str);
    MessageBox.Show(str.ToString());
    }打开记事本。。随便输入,然后运行以上程序。。
      

  7.   

    lucbesson(女娃哈哈) :你的方法取记事本就可以取到结果,但是换成QQ,POPO,MSN就不行了.假设我想取POPO正在聊天的聊天记录框里面的值该怎么取?
      

  8.   

    把int hwnd = FindWindow("notepad", null);里面的"notepad", 换成POPO聊天窗口的标题啊
      

  9.   

    KentYu(潜水的鱼) :你试试就知道了,不行!钩不住
      

  10.   

    假如对textbox控件加密了你该怎么办 ?
    除非你能锁定程序的textbox控件,要不就只能获得键盘信息 !
    楼主请仔细看好这一句啊,例如qq这样的软件,现在都到什么版本了 ?
    他们只要对控件加密你就不能准确的应用啦 !
      

  11.   

    lucbesson(女娃哈哈) 写的不错