日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

panel内嵌程序窗体

發布時間:2025/7/14 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 panel内嵌程序窗体 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?

function RunAppInPanel(const AppFileName: string; ParentHandle: HWND; var WinHandle: HWND): Boolean; varsi: STARTUPINFO;pi: TProcessInformation; beginResult := False;// 啟動進程FillChar(si, SizeOf(si), 0);si.cb := SizeOf(si);si.wShowWindow := SW_SHOW;if not CreateProcess(nil, PChar(AppFileName), nil, nil, true,CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, si, pi) then Exit;// 等待進程啟動WaitForInputIdle(pi.hProcess, 10000);// 取得進程的 HandleWinHandle := GetProcessWindow(pi.dwProcessID);if WinHandle > 0 then begin// 設定父窗體Windows.SetParent(WinHandle, ParentHandle);// 設定窗體位置SetWindowPos(WinHandle, 0, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOZORDER);// 去掉標題欄SetWindowLong(WinHandle, GWL_STYLE, GetWindowLong(WinHandle, GWL_STYLE)and (not WS_CAPTION) and (not WS_BORDER) and (not WS_THICKFRAME));Result := True;end;// 釋放 HandleCloseHandle(pi.hProcess);CloseHandle(pi.hThread); end;//var hWin: HWND = 0; //FormClose // if hWin > 0 then PostMessage(hWin, WM_CLOSE, 0, 0); //FormResize // if hWin <> 0 then MoveWindow(hWin, 0, 0, panel1.ClientWidth, panel1.ClientHeight, True);//if not RunAppInPanel(App, panel1.Handle, hWin) then ShowMessage('App not found');

轉載于:https://www.cnblogs.com/MaxWoods/p/3710446.html

總結

以上是生活随笔為你收集整理的panel内嵌程序窗体的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。