PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → WD - Como alterar o nível de prioridade de um processo do windows?
WD - Como alterar o nível de prioridade de um processo do windows?
Iniciado por BOLLER ADRIANO, jul., 02 2016 5:53 AM - Sem resposta
Membro registado
3.655 mensagems
Popularité : +175 (223 votes)
Publicado em julho, 02 2016 - 5:53 AM
//Variables
ValRetour est un entier
hCurrentProcess est un entier

//Récupère le handle du process
hCurrentProcess = API("Kernel32","GetCurrentProcess")

//Modifie la priorité du process
//ABOVE_NORMAL_PRIORITY_CLASS=au dessus de normal
ValRetour = API("Kernel32", "SetPriorityClass", hCurrentProcess, 0x00 FFFF33)

//IDLE_PRIORITY_CLASS=Basse
//Ret = api("Kernel32", "SetPriorityClass", hCurrentProcess, 0xFFFFFF40)
//BELOW_NORMAL_PRIORITY_CLASS=au dessous de normal
//Ret = api("Kernel32", "SetPriorityClass", hCurrentProcess, 0x00004000)
//NORMAL_PRIORITY_CLASS=Normal
//Ret = api("Kernel32", "SetPriorityClass", hCurrentProcess, 0xFFFFFF20)
//HIGH_PRIORITY_CLASS=Haute
//Ret = api("Kernel32", "SetPriorityClass", hCurrentProcess, 0xFFFFFF80)
//REALTIME_PRIORITY_CLASS=Temps réel
//Ret = api("Kernel32", "SetPriorityClass", hCurrentProcess, 0x00000100)

//Controle de l`erreur
SI ValRetour = 0 ALORS
Erreur("Impossible de modifier la priorité.")
FIN


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/