請教:
   如何在DELPHI中獲取一個非DELPHI的窗體句柄.
   就是說是別的程式的窗口句柄!
  
   Thanks!!

解决方案 »

  1.   

    EnumThreadWindows
    利用CreateProcess的返回参数lpProcessInformation.dwThreadId
      

  2.   

    以前见到一大哥写的。你看看有没有帮助。
    The IsWindow function determines whether the specified window handle identifies an existing window. BOOL IsWindow(    HWND hWnd  // handle of window
       );
     ParametershWndSpecifies the window handle.  Return ValuesIf the window handle identifies an existing window, the return value is nonzero.
    If the window handle does not identify an existing window, the return value is zero.
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      hNotepad : Hwnd;
    begin
      hNotePad := FindWindow('NOTEPAD',nil);
      if hNotePad > 0 then SetWindowText(hNotePad,'Good');
    end;