Zenroth,
SetThreadPriority accepts the HANDLE to a thread, and an integer specifying the priority level.
An HWND is not a valid parameter to the SetThreadPriority function.
If you are looking at using the handle to the thread you are currently in, try using GetCurrentThread.
HTH,
-mordell