本帖最后由 sunandmoonmaster 于 2014-03-31 18:36:51 编辑

解决方案 »

  1.   

    哎,自己解决了,这里人气太差了,我把方法写出来,希望对有些兄弟有用。
    function GetAllHandle(hwnd: Integer; lparam: Longint):Boolean; stdcall;
    var
      buffer,str: array[0..255] of Char;
      buffer1: array[0..255] of Char;
      s:string;
      int:integer;
    begin
      Result := True;
      GetClassName(hwnd,buffer,256);
      Form1.listbox1.Items.add(format('句柄:%d   类名:%s',[hwnd,StrPas(Buffer)]));//写入窗口ListBox中
      if StrPas(Buffer)='Edit' then
      begin
         SendMessage(hwnd,WM_GETTEXT,255,integer(@str));
         //form1.memo1.lines.add(StrPas(str));
         if StrPas(str)<>'' then
            form1.StringGrid1.Cells[3,lint]:=StrPas(str);
      end;
    end;
    procedure TForm1.Button13Click(Sender: TObject);
    var
       Handle:THandle;
    begin
      Handle:=findWindow(nil,'另存为');
       EnumChildWindows(Handle, @GetAllHandle, Integer(@Handle));end;文件名就存在在edit里,由于存在两个edit,因此采用该方法就OK了。顺便悬赏一下,哪位兄弟能帮解决这个问题,本人愿出1000~1500,http://task.zhubajie.com/3704807/