personally, I used a light sensor, mounted next to the little red blinky light for my security system, and hacked the lcd case open, and just use the light sensor as a variable resistor for the LCD backlight power line..
I would NOT seguest doing this if your not farmilure with electronics; but in my situation, it worked out rather well... at daybreak, the sunload/light sensor sits at 0 ohms resistance, and at night, it goes up to 10k ohms.
But, back to your question:
SendMessage is what your looking for; SetDeviceGammaRamp() is your golden egg =)
Option 2, which is a bit messy for actual workstations, but should work fine in a carputer, is DeviceIoControl():
This link gives a great walkthrough on how to use it properly; only catch, is when it fails it tends to set the gamma to 0, making the screen VERY dark (remember to SAVE your work before testing) a reboot will cure the blacked screen =D
The software solutions will NOT control the LCD backlight, which leaves alot of ambient light in the car at night; which is why I went for a hardware solution.