You can create a Direct3D light object by calling the IDirect3D::CreateLight method. The following example demonstrates how to create an IDirect3DLight interface, and then it sets the light by calling the IDirect3DLight::SetLight method.
lpDirect3D->CreateLight(
lplpDirect3DLight, // Address of a new light
pUnkOuter); // NULL
lpDirect3DLight->SetLight(
lpLight); // Address of a D3DLIGHT structure
Light objects reside on the interface list and on a viewport list. You can use the IDirect3DLight interface to get and set lights.