Change The priority of a task when ran

December 30, 2011 at 00:32:05
Specs: Windows 7
I need to make notepad run,when ever its ran,in high priority, so when i run the line of code it'll keep looping until it has set notepad to high priority.


What do i need to import to use the Sleep Command?

If you can but that into the code that will be appreciated, so won't eat 1/2 my CPU

Thank you.

See More: Change The priority of a task when ran

Report •

December 30, 2011 at 08:20:01
Why would you want something like notepad in high priority. It just sits there doing nothing until a key is pressed or a mouse is clicked. I am pretty certain that you cannot type fast enough to make a high priority task make any difference. What is it you are trying to achieve?

You can invoke Sleep by using the sleep API

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sleep 1000 will put the application to sleep for one second

You realise of course that all sleep does is freeze the current application so nothing happens until the sleep period expires. No keyboard input, no mouse clicks, nothing. Most applications for the sleep function are usually only for a few milliseconds, usually to allow time for some external function to complete, like deleting a file, before the application proceeds with the next line of code.


Report •

December 30, 2011 at 15:05:51
I was using notepad as an example, it's truly a game engine.which I will distribute to others.

Report •

Related Solutions

Ask Question