Thanks, Peter, that seems to do what I'm after. Unfortunately I'm
completely new to VB and I'm not sure I'm translating the DLL imports
correctly to C#. Do you know if there is a C# example of this code
somewhere? I found this as well, but that doesn't talk about backlight
issues:
http://www.pcreview.co.uk/forums/thread-2299260.php
====== VB ==================================
Private Declare Function SetPowerRequirement Lib "coredll.dll" (ByVal
pvDevice As String, ByVal DeviceState As PowerState, ByVal DeviceFlags
As Integer, ByVal pvSystemState As IntPtr, ByVal StateFlags As Integer)
As IntPtr
Private Declare Function ReleasePowerRequirement Lib "coredll.dll"
(ByVal handle As IntPtr) As Integer
==================================
translated to C#
==== C# ==================================
[DllImport("coredll.dll", SetLastError = true)]
internal extern static int SetPowerRequirement(string pvDevice,
DevicePowerState deviceState, int deviceFlags, ref ??? systemState, int
StateFlags);
[DllImport("coredll.dll", SetLastError = true)]
internal extern static int ReleasePowerRequirement(???);
=========================================
The '???' mark where I got lost
Any suggestions?