Advertisement
Guest User

Untitled

a guest
May 25th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3. #define R_LIGHT 0xc00d0000
  4. #define L_LIGHT 0xc00e0000
  5. #define B_LIGHT 0xc00c0000
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. // get desired color from commandline
  10. int light_color[3] = {0, 0, 0};
  11. for (int i = 1; i < argc; i++) {
  12. light_color[i-1] = atoi(argv[i]);
  13. }
  14.  
  15. long light_color_long = (light_color[2] & 255)+((light_color[1] & 255)*0x100)+((light_color[0] & 255)*0x10000);
  16.  
  17. // load dll
  18. HMODULE ACPIWMI = LoadLibrary("ACPIWMI.dll");
  19.  
  20. // get functions from dll
  21. FARPROC AsWMI_Open = GetProcAddress(ACPIWMI, "AsWMI_Open");
  22. FARPROC AsWMI_DeviceControl = GetProcAddress(ACPIWMI, "AsWMI_DeviceControl");
  23.  
  24. // open ACPI for calls
  25. AsWMI_Open();
  26. // set right side lights
  27. AsWMI_DeviceControl(R_LIGHT, light_color_long);
  28. // set left side lights
  29. AsWMI_DeviceControl(L_LIGHT, light_color_long);
  30. // set bottom lights
  31. AsWMI_DeviceControl(B_LIGHT, light_color_long);
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement