|
wince不支持鼠标钩子,所以不能用钩子函数,楼主是想改变触摸屏的显示亮度吗?
DWORD getBlightBrightLevel()
{
DWORD BufIn=0;
if (hBacklight != INVALID_HANDLE_VALUE)
{
DeviceIoControl(hBacklight,IOCTL_GetPower_BACKLIGHTNESS,&BufIn,sizeof(BufIn), NULL, 0, NULL, NULL);
return BufIn;
}
else
return (-1);
}
void setBlightBrightLevel(DWORD *lpdwValue)
{
DWORD BufIn = 0;
if (hBacklight != INVALID_HANDLE_VALUE)
{
BufIn=*lpdwValue;
DeviceIoControl(hBacklight, IOCTL_SetPower_BACKLIGHTNESS,(LPVOID)BufIn,sizeof(BufIn), NULL, 0, NULL, NULL);
DeviceIoControl(hBacklight, IOCTL_SetBattery_BACKLIGHTNESS,(LPVOID)BufIn,sizeof(BufIn), NULL, 0, NULL, NULL);
}
else
{
MessageBox( NULL, _T("set bright fail"), _T("fail"), 1 );
}
}
void setBlightOnOff(DWORD *lpdwValue)
{
DWORD BufIn=0;
if (hBacklight != INVALID_HANDLE_VALUE)
{
BufIn=*lpdwValue;
DeviceIoControl(hBacklight, IOCTL_SetOnPowerOnOff_BACKLIGHT,(LPVOID)BufIn,sizeof(BufIn), NULL, 0, NULL, NULL);
}
else
{
MessageBox( NULL, _T("setBlightOnOff"), _T("fail"), 1 );
}
}
这三个函数可以参考一下 |
|