全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:3014
推到 Plurk!
推到 Facebook!

CreateProcess StartupInfo 無法改便啟始位置嗎?

缺席
shunchia63
高階會員


發表:26
回覆:141
積分:198
註冊:2007-05-22

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-03-05 11:28:31 IP:61.62.xxx.xxx 訂閱
CreateProcess   StartupInfo  無法改便啟始位置嗎?
如下代碼
指定 StartupInfo後無法變更外部程式的Postion 與 Size

SDK 說明:
要設定
StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_USESIZE or STARTF_USEPOSITION ;

Size 與Postion 才有作用, 試過無法變更




var StartupInfo:TStartupInfo;
pi:PROCESS_INFORMATION;
Buffer,INBuf:array[0..255] of char;
tmp:String;
InRead,InWrite,OutRead,OutWrite:THandle;
Env:array[0..255] of char;
buf:String;
BytesRead:longInt;
begin
// FillChar( StartupInfo, sizeof( StartupInfo ), #0 );
StartupInfo.cb := sizeof( StartupInfo );
StartupInfo.lpReserved := nil;
StartupInfo.lpDesktop := nil;
StartupInfo.lpTitle := nil;
StartupInfo.dwX := 700;
StartupInfo.dwY := 700;
StartupInfo.dwXSize := 700;
StartupInfo.dwYSize := 700;
StartupInfo.cbReserved2 := 0;
StartupInfo.lpReserved2 := nil;
StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_USESIZE or STARTF_USEPOSITION ; //* To use wShowWindow and the in/output windows
StartupInfo.wShowWindow := SW_SHOWDEFAULT ; //* to hide the window
if not CreateProcess(nil,Pchar(filename),nil,nil,false,0,nil,nil,StartupInfo,pi) then //* Start the program
begin
end
shunchia63
高階會員


發表:26
回覆:141
積分:198
註冊:2007-05-22

發送簡訊給我
#2 引用回覆 回覆 發表時間:2008-03-11 17:24:29 IP:61.62.xxx.xxx 訂閱
看起來無法變更,原始的Window已經決定了



dwX, dwY
Ignored unless dwFlags specifies STARTF_USEPOSITION. Specifies the x and y offsets, in pixels, of the upper left corner of a window if a new window is created. The offsets are from the upper left corner of the screen. For GUI processes, the specified position is used the first time the new process calls CreateWindow to create an overlapped window if the x parameter of CreateWindow is CW_USEDEFAULT.
dwXSize, dwYSize
Ignored unless dwFlags specifies STARTF_USESIZE. Specifies the width (dwXSize) and height (dwYSize), in pixels, of the window if a new window is created. For GUI processes, this is used only the first time the new process calls CreateWindow to create an overlapped window if the nWidth parameter of CreateWindow is CW_USEDEFAULT.

系統時間:2024-03-29 16:12:40
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!