WinAPI: Change Priority of InputThread

Started by
5 comments, last by Evil Steve 16 years, 1 month ago
Hi, i want to change the priority of the windows generated InputThread. I have no clue how to obtain the corresponding handle to this thread, needed as argument for the SetThreadPriority function. I googled several hours but couldn't find any hint. Hope, someone can help me!
Advertisement
The CreateThread function will return a handle for it.

If it's your primary execution thread, use GetCurrentThread.

Happy coding
What do you mean by "windows generated InputThread"?? Do you mean that your app generated it using the Windows API, or that it's some thread generated for you?
@LordShade: The thread is not created using CreateThread and isn't the primary execution thread. Thanks though.

@MJP. In Visual Studio i can see 3 threads, running in the main process: WinMainCRTStartup, ProcessThread, InputThread. They must be automatically produced by Windows when creating a window.
What libraries are you using? Windows doesn't create any extra threads for window handling, so it must be another library you're linking to.

If you double click on the thread in the Threads window in the debugger, you can see what code is running.
Ok, now i see that the thread actually belongs to a kind of library. [oh]
So i have to find another solution for my problem. But that's another issue..

Thanks again!
Quote:Original post by merphi
Ok, now i see that the thread actually belongs to a kind of library. [oh]
So i have to find another solution for my problem. But that's another issue..

Thanks again!
Why do you need to change its priority? You could enumerate all the threads in your process and if you can work out which thread is the InputThread, you can use SetThreadPriority to change it's priority.

This topic is closed to new replies.

Advertisement