ACPI:
You need to learn about and use the WMI - Windows system management interface. Here are a few resources that will give you clues on where to start:
Note that some motherboards don't support fan speed changes, and even those that do may not expose this to the WMI. In the best case you may still have to detect the motherboard type and talk to the fan management controllers directly.
No ACPI:
If you don't want to use ACPI then you're going to have to write your own code to access the SMBUS on the motherboard, and then control the fan controller chips.
Check out the program motherboard monitor for clues on how to get started. It's nontrivial, since every motherboard and bios is different.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…