Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #define R_LIGHT 0xc00d0000
- #define L_LIGHT 0xc00e0000
- #define B_LIGHT 0xc00c0000
- int main(int argc, char *argv[])
- {
- // get desired color from commandline
- int light_color[3] = {0, 0, 0};
- for (int i = 1; i < argc; i++) {
- light_color[i-1] = atoi(argv[i]);
- }
- long light_color_long = (light_color[2] & 255)+((light_color[1] & 255)*0x100)+((light_color[0] & 255)*0x10000);
- // load dll
- HMODULE ACPIWMI = LoadLibrary("ACPIWMI.dll");
- // get functions from dll
- FARPROC AsWMI_Open = GetProcAddress(ACPIWMI, "AsWMI_Open");
- FARPROC AsWMI_DeviceControl = GetProcAddress(ACPIWMI, "AsWMI_DeviceControl");
- // open ACPI for calls
- AsWMI_Open();
- // set right side lights
- AsWMI_DeviceControl(R_LIGHT, light_color_long);
- // set left side lights
- AsWMI_DeviceControl(L_LIGHT, light_color_long);
- // set bottom lights
- AsWMI_DeviceControl(B_LIGHT, light_color_long);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement