Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:36:27+00:00 2026-06-01T19:36:27+00:00

I hope this post is not a duplicate one. Let me explain: I have

  • 0

I hope this post is not a duplicate one. Let me explain:

I have considered the similar post How to pause / resume any external process under Windows? but with C++/Python preference and yet without an accepted answer as of the time of posting.


My Question:

I’m interested in a possible implementation in Delphi of the functionality provided by PsSuspend by Mark Russinovich of Windows Sysinternals.

Quotes:

PsSuspend lets you suspend processes on the local or a remote system,
which is desirable in cases where a process is consuming a resource
(e.g. network, CPU or disk) that you want to allow different processes
to use. Rather than kill the process that’s consuming the resource,
suspending permits you to let it continue operation at some later
point in time.

Thank you.


Edit:

A partial implementation will do. Remote capability can be dropped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:36:28+00:00Added an answer on June 1, 2026 at 7:36 pm

    You can try to use the following code. It uses the undocumented functions NtSuspendProcess and NtResumeProcess. I’ve tried it on Windows 7 64-bit from the 32-bit application built in Delphi 2009 and it works for me. Note that these functions are undocumented thus can be removed from future versions of Windows.

    Update

    The SuspendProcess and ResumeProcess wrappers from the following code are now functions and returns True if succeed, False otherwise.

    type
      NTSTATUS = LongInt;
      TProcFunction = function(ProcHandle: THandle): NTSTATUS; stdcall;
    
    const
      STATUS_SUCCESS = $00000000;
      PROCESS_SUSPEND_RESUME = $0800;
    
    function SuspendProcess(const PID: DWORD): Boolean;
    var
      LibHandle: THandle;
      ProcHandle: THandle;
      NtSuspendProcess: TProcFunction;
    begin
      Result := False;
      LibHandle := SafeLoadLibrary('ntdll.dll');
      if LibHandle <> 0 then
      try
        @NtSuspendProcess := GetProcAddress(LibHandle, 'NtSuspendProcess');
        if @NtSuspendProcess <> nil then
        begin
          ProcHandle := OpenProcess(PROCESS_SUSPEND_RESUME, False, PID);
          if ProcHandle <> 0 then
          try
            Result := NtSuspendProcess(ProcHandle) = STATUS_SUCCESS;
          finally
            CloseHandle(ProcHandle);
          end;
        end;
      finally
        FreeLibrary(LibHandle);
      end;
    end;
    
    function ResumeProcess(const PID: DWORD): Boolean;
    var
      LibHandle: THandle;
      ProcHandle: THandle;
      NtResumeProcess: TProcFunction;
    begin
      Result := False;
      LibHandle := SafeLoadLibrary('ntdll.dll');
      if LibHandle <> 0 then
      try
        @NtResumeProcess := GetProcAddress(LibHandle, 'NtResumeProcess');
        if @NtResumeProcess <> nil then
        begin
          ProcHandle := OpenProcess(PROCESS_SUSPEND_RESUME, False, PID);
          if ProcHandle <> 0 then
          try
            Result := NtResumeProcess(ProcHandle) = STATUS_SUCCESS;
          finally
            CloseHandle(ProcHandle);
          end;
        end;
      finally
        FreeLibrary(LibHandle);
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this question is not considered too basic for this forum, but we'll
I hope this question is not too off-topic, if it is this post can
Hope this post will not be killed on the ground of NOT PROGRAMMING RELATED.
This is my first post on stackoverflow, I hope one of many! My question
Hello I hope this is my last post concerning sql connectionsstrings.... I have a
I hope this is the right place to post this. If not, please redirect
This is my first time here so I hope I post this question at
My first post here, so i hope this is the right area. I am
Hope this is not a dupe. I would like to be able to do
I hope this question does not come off as broad as it may seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.