1、不会,没见过奇迹
2、下面的代码试试,不一定行
var
TheProgHwnd:Hwnd;
Stext:string;
function EnumWindowsProc(AHWnd: HWnd;
LPARAM: lParam): boolean;
stdcall;
var
WndCaption: array[0..254] of char;
WndClassName: array[0..254] of char;
ParentHWnd:hwnd;
begin
GetWindowText(AHWnd, @WndCaption, 254);
GetClassName(AHWnd, @WndClassName, 254);
ParentHWnd:=GetParent(AHWnd);
if StrPas(WndCaption)= Stext then
begin
TheProgHwnd:=FindWindow(WndClassName,WndCaption);
end;
Result := True;
end;
{$R *.dfm}
procedure TForm1.asdfsdf1Click(Sender: TObject);
var Myprog:Hwnd;
begin
stext:='progname';
EnumWindows(@EnumWindowsProc, 0);
windows.SetParent(TheProgHwnd,Handle);
moveWindow(TheProgHwnd,0,0,800,600,True);
end;