我查了网上关于QQ的例子,好像不行。我在spy++中查到了对应窗口及对应控件的句柄,也看到了里面有消息在不断处理,但我不回用钩子,不知道如何才能收到其中的内容。还请高人指点。谢谢!

解决方案 »

  1.   

    POPO控件类不是标准的,我不知道怎么玩!
      

  2.   

    我找到句柄了,在spy++中看到了有消息不断在收发。但我不知道如何截获此类消息,并利用其获得对应窗口显示的内容。
      

  3.   

    哈哈,兄弟慢慢找吧,找到别忘告诉我啊!睡觉ing!
      

  4.   

    这个能得到text文本框里的内容 在time的事件里  
    procedure TForm1.Timer1Timer(Sender: TObject);
    var
       Pos: TPoint;
       Handle: HWND;
       vBuffer: array[0..255] of Char;
    begin
         GetCursorPos(Pos); // 得到当前光标位置
         Handle := WindowFromPoint(Pos); // 返回当前位置的句柄
         SendMessage(Handle, WM_GETTEXT, SizeOf(vBuffer), Integer(@vBuffer)); //通过WM_GETTEXT取得文本~~
         Label1.Caption := vBuffer;
    end;
      

  5.   

    楼上的,不行。通过WM_GETTEXT获得不到文本。好像必须要通过HOOK它自定义的消息WM_USER才行。
      

  6.   

    uses SHDocVw,MSHTML;procedure GetIETextField(w:longint):TStringList;var i,k:integer;    ShellWindow: IShellWindows;    IE:IWebBrowser2;    IDoc:IHTMLDocument2;    spDisp:IDispatch;    aInputText:IHTMLInputTextElement;    v:OLEVariant;    tmpList:TStringList;begin  tmpList:=TStringList.Create;  ShellWindow:=CoShellWindows.Create;  for k:=0 to ShellWindow.Count-1 do    begin      v:=k;      spDisp:=ShellWindow.Item(v);      spDisp.QueryInterface(IWEBBROWSER2,IE);      if IE=nil then continue;      if IE.Get_HWND<>w then continue;      IDoc:=IE.Document as IHTMLDocument2;      if iDoc=nil then continue;      if Idoc.Frames.Length<>0 then continue;      for i:=0 to Idoc.all.length-1 do        begin          if Idoc=nil then Break;          spDisp:=Idoc.all.item(i,varEmpty);          if SUCCEEDED(spDisp.QueryInterface(IHTMLInputTextElement,aInputText)) then            if aInputText.value<>'' then  //****//              tmpList.add('name:'+aInputText.name+'  value:'+aInputText.value);        end;      break;    end;  result:=tmpList;end;
    如果要对特定的输入框 ,只需要在 //****// 那行进行判断 :if aInputText.name='xxxxxxx' then
      

  7.   

    无奈结帖。看来CSDN也没人会。