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. Priority

Priority

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
5 Posts 5 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
    Manikandan
    wrote on last edited by
    #1

    My application is CPU time sensitive. When it runs i want to suspend all other applications including mouse & keyboard. I know SetThreadPriority got something to do with this. But I dont know how to use it. Anyone can help me ;P

    A N H B 4 Replies Last reply
    0
    • M Manikandan

      My application is CPU time sensitive. When it runs i want to suspend all other applications including mouse & keyboard. I know SetThreadPriority got something to do with this. But I dont know how to use it. Anyone can help me ;P

      A Offline
      A Offline
      Arsalan Malik
      wrote on last edited by
      #2

      By setting thread priority, you cannot stop mouse or keyboard. For mouse or keyboard, you have to disable interrupts:)  ARSALAN MALIK

      1 Reply Last reply
      0
      • M Manikandan

        My application is CPU time sensitive. When it runs i want to suspend all other applications including mouse & keyboard. I know SetThreadPriority got something to do with this. But I dont know how to use it. Anyone can help me ;P

        N Offline
        N Offline
        Neville Franks
        wrote on last edited by
        #3

        Please tell us all the name of your program so we know never to use it.:wtf: Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

        1 Reply Last reply
        0
        • M Manikandan

          My application is CPU time sensitive. When it runs i want to suspend all other applications including mouse & keyboard. I know SetThreadPriority got something to do with this. But I dont know how to use it. Anyone can help me ;P

          H Offline
          H Offline
          Henry miller
          wrote on last edited by
          #4

          You cannot do this in a normal windows program. You might be able to do this by running all your code in a device driver (Ring 0). Note that I said might. There are non maskable interupts on PCs, and windows wasn't designed for drivers to mask interupts for very long. Odds are very good that you will see many unwanted side effects no matter how you work things. You need a real time OS, on hardware designed for this. Windows XP/NT is not. Windows CE is, maybe. Learn something about real time operating systems, and the problems they face. Decide which is for you. Until you understand this subject (which is very large) you cannot ask the right questions.

          1 Reply Last reply
          0
          • M Manikandan

            My application is CPU time sensitive. When it runs i want to suspend all other applications including mouse & keyboard. I know SetThreadPriority got something to do with this. But I dont know how to use it. Anyone can help me ;P

            B Offline
            B Offline
            Bob Stanneveld
            wrote on last edited by
            #5

            Why in the name of God do you want to stop the user from interaction with the computer? That would be the worst thing a developer can do... The way you get most CPU cicles is to set the priority to REALTIME. (more that a system process). Even that is not a wise thing to do. And the best and fastest way to get access to information on api's is to take a peek in MSDN[^]. Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.

            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