08-01-2011، 07:49 PM
برای بازکردن کنترل پنل می توانید از این تابع استفاده کنید:
کد:
-Add 'ShellApi and ShlObj' in the uses of your form
procedure TForm1.Button1Click(Sender: TObject);
var
PIDL:PItemIDList;
Info:TShellExecuteInfo;
pInfo:PShellExecuteInfo;
WaitCode:DWord;
begin
{Obtenemos PIDL de la carpeta virtual}
{get PIDL of the virtual folder}
SHGetSpecialFolderLocation(Handle,
CSIDL_CONTROLS,
PIDL);
{Puntero a Info}
{Pointer to Info}
pInfo:=@Info;
{Rellenamos Info}
{Fill info}
with Info do
begin
cbSize:=SizeOf(Info);
fMask:=SEE_MASK_NOCLOSEPROCESS+
SEE_MASK_IDLIST;
wnd:=Handle;
lpVerb:=nil;
lpFile:=nil;
{Parametros al ejecutable}
{Executable parameters}
lpParameters:=nil;
lpDirectory:=nil;
nShow:=SW_ShowNormal;
hInstApp:=0;
lpIDList:=PIDL;
end;
{Ejecutamos}
{Execute}
ShellExecuteEx(pInfo);
{Esperamos que termine}
{Wait to finish}
repeat
WaitCode := WaitForSingleObject(Info.hProcess,500);
Application.ProcessMessages;
until (WaitCode <> WAIT_TIMEOUT);
end;