AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Process Priorität setzen - als Variable...
Thema durchsuchen
Ansicht
Themen-Optionen

Process Priorität setzen - als Variable...

Ein Thema von DRPEnc · begonnen am 15. Mär 2004 · letzter Beitrag vom 13. Apr 2006
 
DRPEnc

Registriert seit: 20. Feb 2004
Ort: Noch unterm Mond
126 Beiträge
 
#12

Re: Process Priorität setzen - als Variable...

  Alt 19. Mär 2004, 20:57
Man ich steh mal wieder sehr stark auf dem Schlauch...

So siehts bei mir grad aus:

ComboBox17 mit

ItemIndex0 Idle
ItemIndex1 Normal
ItemIndex2 High

Edit153



Delphi-Quellcode:
var ProcID: Cardinal;
    P: TCaption;
begin

//RunBatch
if form1.ComboBox17.ItemIndex=0 then form1.Edit153.Text:='IDLE_PRIORITY_CLASS';
if form1.ComboBox17.ItemIndex=1 then form1.Edit153.Text:='NORMAL_PRIORITY_CLASS';
if form1.ComboBox17.ItemIndex=2 then form1.Edit153.Text:='HIGH_PRIORITY_CLASS';
ProcID := 0;
P := Edit153.text;
RunProcess('C:\DRPEncPrediction.bat', SW_SHOW, TRUE, @ProcID {, Hier muss Priorität rein});
Kann aber nicht mal ne Variable in den RunProcess setzen.
Kommt immer diese Fehlermeldung:
To many actual parameters.

Irgendeine Idee. Deine Idee kann ich irgendwie nicht umsetzen.

Hier nochmal die Funktion von Luckie:

Delphi-Quellcode:
function RunProcess(FileName: string; ShowCmd: DWORD; wait: Boolean; ProcID: PDWORD): Longword;
var
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
begin
  FillChar(StartupInfo, SizeOf(StartupInfo), #0);
  StartupInfo.cb := SizeOf(StartupInfo);
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
  StartupInfo.wShowWindow := ShowCmd;
  if not CreateProcess(nil,
    @Filename[1],
    nil,
    nil,
    False,
    CREATE_NEW_CONSOLE or
    NORMAL_PRIORITY_CLASS,
    nil,
    nil,
    StartupInfo,
    ProcessInfo)
    then
      Result := WAIT_FAILED
  else
  begin
    if wait = FALSE then
    begin
      if ProcID <> nil then ProcID^ := ProcessInfo.dwProcessId;
      exit;
    end;
    WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, Result);
  end;
  if ProcessInfo.hProcess <> 0 then
    CloseHandle(ProcessInfo.hProcess);
  if ProcessInfo.hThread <> 0 then
    CloseHandle(ProcessInfo.hThread);
end;
CU

DRPEnc
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:15 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz