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. C / C++ / MFC
  4. Setting Priority Class

Setting Priority Class

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 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.
  • P Offline
    P Offline
    philliad
    wrote on last edited by
    #1

    Hello, all. I'm trying to have the program I'm writing raise its class and thread priorities on a button click. I can change the thread priorities just fine, but I'm having trouble with the priority class. Here's the code from the function that I'm using to change the priorities: HANDLE Hand; BOOL Check; DWORD Error; Hand = GetCurrentThread(); Check = SetPriorityClass(Hand, HIGH_PRIORITY_CLASS); Error = GetLastError(); Check = SetThreadPriority(Hand, THREAD_PRIORITY_HIGHEST); Error = GetLastError(); Does anybody have any idea why I can change the thread priority but not the priority class? Thanks, Phillip

    J 1 Reply Last reply
    0
    • P philliad

      Hello, all. I'm trying to have the program I'm writing raise its class and thread priorities on a button click. I can change the thread priorities just fine, but I'm having trouble with the priority class. Here's the code from the function that I'm using to change the priorities: HANDLE Hand; BOOL Check; DWORD Error; Hand = GetCurrentThread(); Check = SetPriorityClass(Hand, HIGH_PRIORITY_CLASS); Error = GetLastError(); Check = SetThreadPriority(Hand, THREAD_PRIORITY_HIGHEST); Error = GetLastError(); Does anybody have any idea why I can change the thread priority but not the priority class? Thanks, Phillip

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      BOOL SetPriorityClass( HANDLE hProcess, // handle to the process DWORD dwPriorityClass // priority class value ); GetCurrentProcess will give u the handle of the current process Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      P 1 Reply Last reply
      0
      • J jmkhael

        BOOL SetPriorityClass( HANDLE hProcess, // handle to the process DWORD dwPriorityClass // priority class value ); GetCurrentProcess will give u the handle of the current process Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        P Offline
        P Offline
        philliad
        wrote on last edited by
        #3

        Thanks for your help! Your solution works great! Thanks, Phillip

        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