Announcement

Collapse
No announcement yet.

Priorität einer 16 Bit Applikation setzen (CreateProcess)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Priorität einer 16 Bit Applikation setzen (CreateProcess)

    Über CreateProcess habe ich eine 16 bit Applikation gestartet. Diese läuft bei mir immer mit der Priorität NORMAL. Ich möchte sie aber mit der Priorität IDLE starten. Mit CreateProcess und dem Parameter IDLE_CLASS_PRIORITY funktioniert das aber nicht, die Priorität bleibt auf NORMAL.
    Wenn ich im Taskmanager die Priorität von NTVDM auf niedrig setze wird auch meine 16 bit Applikation auf niedrig gesetzt. Wie kann ich das aber in meinem Programm realisieren ?

    Christoph

  • #2
    HI Christoph,

    ich habe nun das gleiche Problem und wollte Dich mal fragen, ob Du hierfür schon eine Antwort gefunden hast???

    Wäre supernett, wenn Du mir hierfür auf diese Adresse antwortest:

    [email protected]

    Danke und Gruß

    Andrea

    Comment


    • #3
      <pre><p><b>procedure</b> TForm1.Button1Click(Sender: TObject);
      <b>var</b>
      si: TStartupInfo;
      pi: TProcessInformation;
      <b>begin</b>
      FillChar(si, SizeOf(si), 0);
      si.cb := SizeOf(si);
      si.dwFlags := STARTF_USESHOWWINDOW;
      si.wShowWindow := SW_SHOWDEFAULT;
      <b>if</b> CreateProcess(<b>nil</b>, <font color='blue'>'Z:\temp\SmBios\SmBiosW.exe'</font>, <b>nil</b>, <b>nil</b>, False,
      CREATE_NEW_PROCESS_GROUP <b>or</b> CREATE_SEPARATE_WOW_VDM, <b>nil</b>, <b>nil</b>, si, pi) <b>then</b>
      <b>try</b>
      <font color='blue'>// wait until NT Virtual DOS Machine (NTVDM) and the
      // Starter for Windows Win16 applications (WowExec)
      // are initialized (earlier settings have no effect)</font>
      WaitForInputIdle(pi.hProcess, INFINITE);
      SetPriorityClass(pi.hProcess, IDLE_PRIORITY_CLASS);
      <p>
      WaitForSingleObject(pi.hProcess, INFINITE);
      <b>finally</b>
      CloseHandle(pi.hProcess);
      CloseHandle(pi.hThread);
      <b>end</b>;
      <b>end</b>;<p></pre>

      - nic

      Comment


      • #4
        Hi Nico,

        Thanks for your help. I try your solution.

        greetings

        Andrea

        Comment


        • #5
          Hi,

          ich habe es ausprobiert, funktioniert aber nicht. Ich habe es über den Taskmanager geprüft. Prioritäten stehen immer auf NORMAL.

          Gruß

          Andrea

          Comment

          Working...
          X