5,388
社区成员
发帖
与我相关
我的任务
分享
var vh: HWND;
begin
ShellExecute(Self.Handle,'open',Pchar('C:\Windows\System32\notepad.exe'),'',nil,SW_SHOWNORMAL);
sleep(1000); // 延迟一下,等待记事三打开。
vh := Winapi.Windows.FindWindow(nil, '无标题 - 记事本');
if vh<>0 then
begin
Winapi.Windows.SetParent(vh, Self.Panel1.Handle);
Winapi.Windows.MoveWindow(vh, 0, 0,Self.Panel1.Width,Self.Panel1.Height,False);
end
else
ShowMessage('xx程序未运行!');
效果如下: