Einzelnen Beitrag anzeigen

Benutzerbild von CoRe.eXtreem
CoRe.eXtreem

Registriert seit: 30. Nov 2003
61 Beiträge
 
Delphi 2005 Personal
 
#1

CreateProcess [Frage!]

  Alt 29. Feb 2004, 09:54
Guten morgen,
habe hier folgendes problem:

Delphi-Quellcode:
procedure TForm1.Benutzerkonten1Click(Sender: TObject);
var
temp : integer;
  StartupInfo: TStartupinfo;
  ProcessInfo: TProcessInformation;
begin
 try
  FillChar(Startupinfo,Sizeof(TStartupinfo),0);
  Startupinfo.cb:=Sizeof(TStartupInfo);
  temp := GetWindowLong(Handle, GWL_EXSTYLE);
  temp := temp or WS_EX_LAYERED;
  SetWindowLong(Handle, GWL_EXSTYLE, temp);
  SetLayeredWindowAttributes(Handle, 0, 200, LWA_ALPHA);
  Application.ProcessMessages;
  if CreateProcess(nil,'notepad.exe',Nil,Nil,false,normal_priority_class,Nil,
                       Nil, Startupinfo,ProcessInfo) then
{Wollte rundll32.exe mit dem Parameter netplwiz.dll,UsersRunDll starten!
Wie kann ich das übernehmen?}

begin
  WaitforSingleObject(Processinfo.hProcess, infinite);
  CloseHandle(ProcessInfo.hProcess);
  temp := GetWindowLong(Handle, GWL_EXSTYLE);
  temp := temp or WS_EX_LAYERED;
  SetWindowLong(Handle, GWL_EXSTYLE, temp);
  SetLayeredWindowAttributes(Handle, 0, 255, LWA_ALPHA);
end;
except
 Form5.Label3.Caption:='Error_On_rundll32.exe';
  inherited;
  FehlerX;
  end;
end;
Kann mir da jemand weiter helfen?
Vielen dank,
gruß CoRe.eXtreem
  Mit Zitat antworten Zitat