Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. How to end CPU Processes

How to end CPU Processes

Scheduled Pinned Locked Moved Windows Forms
questioncsharptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mahmood Rasuli
    wrote on last edited by
    #1

    Hi I want to create a c# program and i have a question: How can I end a process that running in CPU? Thanks.

    D G 2 Replies Last reply
    0
    • M Mahmood Rasuli

      Hi I want to create a c# program and i have a question: How can I end a process that running in CPU? Thanks.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Get it's Process instance from Process.GetProcessByName (or whatever your need requires) and call its CloseMainWindow method, or (more risky) its Kill method. Process class docs[^]

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      1 Reply Last reply
      0
      • M Mahmood Rasuli

        Hi I want to create a c# program and i have a question: How can I end a process that running in CPU? Thanks.

        G Offline
        G Offline
        gogosai
        wrote on last edited by
        #3

        just to kill the process. BOOL TerminateProcess( HANDLE hProcess, UINT uExitCode); when a process that running in CPU,i don't think we can end it.You just need to use the TerminateProcess function,then the system will end it.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups