【HSP3】Sony VAIO PCG-R505R/GK(2001年発売) の液晶の輝度を変えるサンプルコード

Sony,VAIO,PCG-R505R/GK

Sony,VAIO,PCG-R505R/GK

#include "kernel32.as"
#define FILE_SHARE_READ 0x00000001
#define FILE_SHARE_WRITE 0x00000002
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS 0x00230494
#define IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS 0x00230498
#define IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS 0x0023049C
title "VAIO NOTEBOOK LCD BRIGHTNESS "
//(Sony Notebook Control)
val="\\\\?\\acpi#sny5001#4&2ab4e1f1&0#{f304eb09-5c5f-11d2-b53f-0800460198ac}"
CreateFile val,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,0,3,0,0
if stat=-1:dialog
hlcd=stat
//
l = ""
repeat 9
l+=""+cnt+"\n"
loop
//
buf=0:br=0
DeviceIoControl hLCD,0x00222018,"GBRT",4,varptr(buf),4,varptr(br),0
s = buf
combox s,,l
button "",*set
button "",*ref
stop
*set
//
br = 0
buf.0 = 0x54524253 //SBRT
buf.1 = s
DeviceIoControl hLCD,0x22201c,varptr(buf),8,varptr(buf),8,varptr(br),0
br = 0
buf.0 = 0x52425053 //SBRT
buf.1 = s
DeviceIoControl hLCD,0x22201c,varptr(buf),8,varptr(buf),8,varptr(br),0
stop
*ref
//
buf=0:br=0
DeviceIoControl hLCD,0x00222018,"GBRT",4,varptr(buf),4,varptr(br),0
s = buf
objprm 0,s
stop
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX