笑
笑煞天
Unregistered / Unconfirmed
GUEST, unregistred user!
使用以下方法可以调出系统自带的"属性"窗口,那么如何使此窗口总在最前?或者如何使此窗口变成我的程序的一个子窗口?
function ShowFileProperties(FileName: String; Wnd: HWND):Boolean;
var
sfi: TSHELLEXECUTEINFO;
begin
with sfi do
begin
cbSize := SizeOf(sfi);
lpFile := PAnsiChar(FileName);
Wnd := Wnd;
fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_INVOKEIDLIST or SEE_MASK_FLAG_NO_UI;
lpVerb := PAnsiChar('properties');
lpIDList := nil;
lpDirectory := nil;
nShow := 0;
hInstApp := 0;
lpParameters := nil;
dwHotKey := 0;
hIcon := 0;
hkeyClass := 0;
hProcess := 0;
lpClass := nil;
end;
Result := ShellExecuteEX(@sfi);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowFileProperties('c:/', Handle);
end;
function ShowFileProperties(FileName: String; Wnd: HWND):Boolean;
var
sfi: TSHELLEXECUTEINFO;
begin
with sfi do
begin
cbSize := SizeOf(sfi);
lpFile := PAnsiChar(FileName);
Wnd := Wnd;
fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_INVOKEIDLIST or SEE_MASK_FLAG_NO_UI;
lpVerb := PAnsiChar('properties');
lpIDList := nil;
lpDirectory := nil;
nShow := 0;
hInstApp := 0;
lpParameters := nil;
dwHotKey := 0;
hIcon := 0;
hkeyClass := 0;
hProcess := 0;
lpClass := nil;
end;
Result := ShellExecuteEX(@sfi);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowFileProperties('c:/', Handle);
end;