HotkeyNet: the next generation
REFERENCE
SetAffinity

Sets the CPU affinity of a process.

Syntax

SetAffinity ( window, cpu [, cpu...] );

          or

SetAffinity ( window, all );

Parameters

Window is the name or handle of a window that was created by the process.


CPU is a number that indicates a logical processor. You must specify at least one.


The word "all" means all logical CPUs in the machine.


Contextual keywords

all


Return value

Boolean. True if the function succeeds; otherwise false.


Remarks

This function does the same thing as Windows's Processor Affinity pop up:




CPUs are numbered starting with zero. This means, for example, that the fourth CPU is number three.

SetAffinity calls the operating system function SetProcessAffinityMask.


Example

function f1()
{
   SetAffinity ( "World of Warcraft", all );
}


This page was last revised on June 14, 2009
Copyright © 2009 HotkeyNet Software