[Please use the MSDN forums for questions.
http://social.msdn.microsoft.com/Forums/en-US/category/windevgeneral]
Hi , I am want to develop a program to control the NoteBook backlight .
My NoteBool modle is ASUS A8jc .
System is WinXP SP3.
I am use Visual C++ 2005 .
I can find out the LCD device by QueryDosDevice(TEXT("LCD"), lpTargetPath, MAX_PATH-1);
And get the HANDLE by
hDevice = CreateFile(TEXT("\\\\.\\LCD") , // drive to open
0, // no access to the drive
FILE_SHARE_READ | // share mode
FILE_SHARE_WRITE,
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL); // do not copy file attributes
But when I try to get the brightness support list by DeviceIoControl() then return the error code "2 ERROR_FILE_NOT_FOUND" by GetLastError() .
Why QueryDosDevice() and CreateFile() are success to find out the LCD but DeviceIoControl() not ?
Below is my code , if possible please help to check it .
Much Thanks !
HANDLE hDevice ;
BOOL bResult ;
LPVOID lpOutBuffer[256] ;
DWORD lpBytesReturned ;
DWORD ErrorInfo_0 , ErrorInfo_1 ,ErrorInfo_2;
DWORD qResult ;
TCHAR lpTargetPath[MAX_PATH];
qResult = QueryDosDevice(TEXT("LCD"), lpTargetPath, MAX_PATH-1);
ErrorInfo_0 = GetLastError();
hDevice = CreateFile(TEXT("\\\\.\\LCD") , // drive to open
0, // no access to the drive
FILE_SHARE_READ | // share mode
FILE_SHARE_WRITE,
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL); // do not copy file attributes
ErrorInfo_1 = GetLastError();
bResult = DeviceIoControl(hDevice, // device to be queried
IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS, // operation to perform
NULL, // lpInBuffer
0, // nInBufferSize
lpOutBuffer, // output buffer
sizeof(lpOutBuffer), // size of output buffer
&;;lpBytesReturned, // number of bytes returned
NULL // OVERLAPPED structure
);
ErrorInfo_2 = GetLastError();
CloseHandle(hDevice);