Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   CreateProcess [Frage!] (https://www.delphipraxis.net/17160-createprocess-%5Bfrage-%5D.html)

CoRe.eXtreem 29. Feb 2004 09:54


CreateProcess [Frage!]
 
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? :gruebel:
Vielen dank,
gruß CoRe.eXtreem

CoRe.eXtreem 29. Feb 2004 12:08

Re: CreateProcess [Frage!]
 
Delphi-Quellcode:
var
temp : integer;
begin
try
 temp := GetWindowLong(Handle, GWL_EXSTYLE);
 temp := temp or WS_EX_LAYERED;
 SetWindowLong(Handle, GWL_EXSTYLE, temp);
 SetLayeredWindowAttributes(Handle, 0, 200, LWA_ALPHA);
 ShellExecute(0,
               Nil
               PChar('rundll32.exe'),
               Pchar('netplwiz.dll,UsersRunDll'),
               Nil,
               SW_NORMAL);
 If CloseQuery then begin
 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;
Im prinzip sollte der Transparens grad nur auf null gehen wenn das programm wieder geschlossen wurden!
Das funktioniert aber nicht so ganz mit CloseQuery?

Was ich nicht verstehe wieso funktioniert dann das hier:

Delphi-Quellcode:
var
temp : integer;
begin
try
 temp := GetWindowLong(Handle, GWL_EXSTYLE);
 temp := temp or WS_EX_LAYERED;
 SetWindowLong(Handle, GWL_EXSTYLE, temp);
 SetLayeredWindowAttributes(Handle, 0, 200, LWA_ALPHA);
   ShellAbout(self.Handle, 'Admin-ToolZ v1.6 by CoRe.eXtreem',
             'Copyright © 2003-2004 XTreem-Base' + #13 +
             '', Application.Icon.Handle);
 If CloseQuery then begin
 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_UeberShow';
  inherited;
  FehlerX;
end;
end;
Gruß Core


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:43 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz