title: How do you limit a process' CPU usage on Windows? (need code, not an app)
body: <p>There is programs that is able to limit the CPU usage of processes in Windows. For example <a href="http://mion.faireal.net/BES/" rel="nofollow">BES</a> and <a href="http://threadmaster.tripod.com/" rel="nofollow">ThreadMaster</a>. I need to write my own program that does the same thing as these programs but with different configuration capabilities. Does anybody know how the CPU throttling of a process is done (code)? I'm not talking about setting the priority of a process, but rather how to limit it's CPU usage to for example 15% even if there is no other processes competing for CPU time.</p>
  
  <p><strong>Update:</strong> I need to be able to throttle any processes that is already running and that I have no source code access to.</p>