public enum CEDEVICE_POWER_STATE
{
PwrDeviceUnspecified = -1,
D0 = 0,
D1,
D2,
D3,
D4,
PwrDeviceMaximum
}
[DllImport("coredll.dll", SetLastError = true)]
public static extern IntPtr SetPowerRequirement(
string pvDevice,
CEDEVICE_POWER_STATE DeviceState,
uint DeviceFlags,//1
IntPtr pvSystemState,
uint StateFlags
);
[DllImport("coredll.dll", SetLastError = true)]
public static extern uint ReleasePowerRequirement(
IntPtr hPowerReq
);
IntPtr _backlight = SetPowerRequirement("BKL1:", CEDEVICE_POWER_STATE.D0, 1, IntPtr.Zero, 0);
ReleasePowerRequirement(_backlight);
Public Declare Function SetPowerRequirement Lib "coredll.dll" (ByVal pvDevice As String, ByVal DeviceState As CEDEVICE_POWER_STATE, ByVal DeviceFlags As System.UInt32, ByVal pvSystemState As IntPtr, ByVal StateFlags As System.UInt32) As IntPtr
Public Declare Function ReleasePowerRequirement Lib "coredll.dll" (ByVal hPowerReq As IntPtr) As System.UInt32
Dim _backlight As IntPtr
Public Enum CEDEVICE_POWER_STATE
PwrDeviceUnspecified = -1
D0 = 0
D1
D2
D3
D4
PwrDeviceMaximum
End Enum
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmb2.SelectedItem = cmb2.Items.Item(3)
cmb3.SelectedItem = cmb3.Items.Item(5)
Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("PDA_Метроном.Bp2.wav")
m_soundBytes = New Byte(Stream.Length) {}
Stream.Read(m_soundBytes, 0, Stream.Length)
_backlight = SetPowerRequirement("BKL1:", CEDEVICE_POWER_STATE.D0, Convert.ToUInt32(1), IntPtr.Zero, Convert.ToUInt32(0))
End Sub
Вернуться в Visual Basic для мобильных устройств
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 5