Latest news: November 14, 2008
Advanced WiFi-Manager v3.2 released!
October 21, 2008
WinI2C/DDC Lite v3.22 released!
October 20, 2008
Advanced WiFi-Manager v3.1 released!
October 17, 2008
WinI2C/DDC v3.22 released!
| | |
|
WinI2C/DDC: Developer's Guide
|
Getting Started
WinI2C/DDC consists from three files:
- ddcdrv.sys - The kernel-mode driver supported by Windows 2000/XP/2003/Vista.
Must be located under "<windows>\system32\drivers" folder.
- DDCHelper.dll - The library providing driver function call for almost all programming languages
under 32-bit Windows versions. Must be located under "<windows>\system32" or any other directory
available for the running application.
- DDCHelperX.dll - ActiveX wrapper for DDCHelper.dll file. Must be located under "<windows>\system32" or any other directory
available for the running application. Must be registered through regsvr32.exe before using.
Firstly, you should initialize library by calling InitDDCHelper
function. It will return S_OK (0) value if success, otherwise it will return
error code. WinI2C/DDC driver must be installed, otherwise
this function will return ERROR_CANNOTOPENDRIVER value. Use
InstallDriver and
UninstallDriver functions to install and uninstall driver
(note these functions require administration privileges).
After initialization, you should enumerate all available monitors by calling
EnumGetFirst
and
EnumGetNext
functions and save received WinI2C/DDC display handles.
|
...
#include "ddchelper.h"
...
PEDISP MyDisplay[10];
int MyDisplayCount=0;
if (EnumGetFirst(&MyDisplay[MyDisplayCount]) == S_OK) // S_OK = 0
{
MyDisplayCount++;
while (EnumGetNext(&MyDisplay[MyDisplayCount]) == S_OK)
{
MyDisplayCount++;
}
}
|
Now you can work with enumerated monitors, for example, the following line of code
will set value "50" for the brighness for first enumerated monitor:
|
SetMonitorBrightness(MyDisplay[0], 50);
|
Or you can use SetCIValue function:
|
SetCIValue(MyDisplay[0], 0x10, 50); // 0x10 is the brightness index in DDC/CI specifications.
|
You should call DeinitDDCHelper function when WinI2C/DDC
library is not necessary anymore, this function will release all allocated memory and resources.
WinI2C/DDC package contains demo projects for several programming languages (VB, C++, Delphi, C#, VB.NET), see "Samples" directory
for details.
|
|