Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have some C++ code I'm using as a reference, but I'm not getting it.

C#
void static  AdjustBrightness(BYTE bBrightNess)
{
    bool bRet = FALSE;
    HANDLE hDevBKL;    
    DWORD dwPercent=(DWORD)bBrightNess*6.4;          //3;
    hDevBKL = CreateFile(_T("BKL1:"),
                         GENERIC_READ|GENERIC_WRITE,
                         FILE_SHARE_READ|FILE_SHARE_WRITE,
                         NULL,
                         OPEN_ALWAYS,
                         0,
                         0);
        
    bRet = DeviceIoControl(hDevBKL,
                       IOCTL_BKL_SET_INTENSITY,
                       &dwPercent,
                       sizeof(dwPercent),
                       NULL,
                       0,
                       NULL,
                       NULL);
        

    if(!bRet)
    {
            SetLastError(GetLastError());
    }

I'm looking for sample code on how to change contrast and brightness on window ce 5.0 device using C# , can anyone help me out here ?
Posted
Updated 27-Mar-12 1:26am
v2
Comments
sravani.v 27-Mar-12 7:26am    
Added <pre> tags

1 solution

The author of this project How to query miniport driver information (802.11 OIDs) using the DeviceIOControl() function also uses the Win32 APIs CreateFile and DeviceIoControl in C#. So it might be a good starting point to solve your problem with CreateFile and DeviceIoControl.

And don't forget to close the handle!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900