PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Listing Availible Devices
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Listing Availible Devices
![]() |
Listing Availible Devices |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I just did a great deal of searching to figure out that the device name for the backlight is BKL1: (I've appended code if you want to keep it on with the power manager). But it occurs to me that the backlight device name is arbitrary. I'm just lucky my phone used the same name (right?). Further, this must hold true for all devices. I'm curious. How do I find out the names of all the devices known to my smartphone's OS? Cheers, Gordon. P.S. Code showing how to turn it on/off can be found here:http://www.peterfoot.net/KeepYourSm...acklightOn.aspx (in VB), Or in C# the code I ended up writing: [DllImport("coredll.dll")] static extern bool PowerPolicyNotify( UInt32 dwMessage, UInt32 dwData ); [DllImport("coredll.dll", SetLastError = true, CharSet=CharSet.Unicode)] static extern IntPtr SetPowerRequirement( string device_name, CEDEVICE_POWER_STATE DeviceState, UInt32 DeviceFlags, string pvSystemState, UInt32 StateFlags); enum CEDEVICE_POWER_STATE : int { PwrDeviceUnspecified = -1, D0 = 0, // Full on D1, // Low power on, fully functional at low D2, // Standby: partially owered with automatic wake D3, // Sleep: partially powered with device initaited wake D4, // Off: Unpowered. PwrDeviceMaximum } public const int POWER_NAME = 0x00000001; Code: private IntPtr _power_hold; On: _power_hold = SetPowerRequirement("BKL1:", CEDEVICE_POWER_STATE.D0, POWER_NAME, null, 0); Off: (should do error checking!) ReleasePowerRequirement(_power_hold); |
|
|
|
#2 |
|
Guest
Posts: n/a
|
It's in the registry under HKLM\Drivers\Active
-Chris <gwatts@phys.washington.edu> wrote in message news:1158118203.433940.111820@e3g2000cwe.googlegroups.com... > Hi, > I just did a great deal of searching to figure out that the device > name for the backlight is BKL1: (I've appended code if you want to keep > it on with the power manager). But it occurs to me that the backlight > device name is arbitrary. I'm just lucky my phone used the same name > (right?). Further, this must hold true for all devices. I'm curious. > How do I find out the names of all the devices known to my smartphone's > OS? > > Cheers, > Gordon. > > P.S. Code showing how to turn it on/off can be found > here:http://www.peterfoot.net/KeepYourSm...acklightOn.aspx (in > VB), Or in C# the code I ended up writing: > > [DllImport("coredll.dll")] > static extern bool PowerPolicyNotify( > UInt32 dwMessage, > UInt32 dwData > ); > > [DllImport("coredll.dll", SetLastError = true, > CharSet=CharSet.Unicode)] > static extern IntPtr SetPowerRequirement( > string device_name, > CEDEVICE_POWER_STATE DeviceState, > UInt32 DeviceFlags, > string pvSystemState, > UInt32 StateFlags); > > enum CEDEVICE_POWER_STATE : int > { > PwrDeviceUnspecified = -1, > D0 = 0, // Full on > D1, // Low power on, fully functional at low > D2, // Standby: partially owered with automatic wake > D3, // Sleep: partially powered with device initaited wake > D4, // Off: Unpowered. > PwrDeviceMaximum > } > > public const int POWER_NAME = 0x00000001; > > > Code: > private IntPtr _power_hold; > > On: > _power_hold = SetPowerRequirement("BKL1:", > CEDEVICE_POWER_STATE.D0, > POWER_NAME, null, 0); > Off: (should do error checking!) > ReleasePowerRequirement(_power_hold); > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi,
Thanks! What is a decent registry editor? I didn't see one in the stuff that cae in the SDK (or I just missed it). Cheers, Gordon. <ctacke/> wrote: > It's in the registry under HKLM\Drivers\Active > > -Chris > > > <gwatts@phys.washington.edu> wrote in message > news:1158118203.433940.111820@e3g2000cwe.googlegroups.com... > > Hi, > > I just did a great deal of searching to figure out that the device > > name for the backlight is BKL1: (I've appended code if you want to keep > > it on with the power manager). But it occurs to me that the backlight > > device name is arbitrary. I'm just lucky my phone used the same name > > (right?). Further, this must hold true for all devices. I'm curious. > > How do I find out the names of all the devices known to my smartphone's > > OS? > > > > Cheers, > > Gordon. > > > > P.S. Code showing how to turn it on/off can be found > > here:http://www.peterfoot.net/KeepYourSm...acklightOn.aspx (in > > VB), Or in C# the code I ended up writing: > > > > [DllImport("coredll.dll")] > > static extern bool PowerPolicyNotify( > > UInt32 dwMessage, > > UInt32 dwData > > ); > > > > [DllImport("coredll.dll", SetLastError = true, > > CharSet=CharSet.Unicode)] > > static extern IntPtr SetPowerRequirement( > > string device_name, > > CEDEVICE_POWER_STATE DeviceState, > > UInt32 DeviceFlags, > > string pvSystemState, > > UInt32 StateFlags); > > > > enum CEDEVICE_POWER_STATE : int > > { > > PwrDeviceUnspecified = -1, > > D0 = 0, // Full on > > D1, // Low power on, fully functional at low > > D2, // Standby: partially owered with automatic wake > > D3, // Sleep: partially powered with device initaited wake > > D4, // Off: Unpowered. > > PwrDeviceMaximum > > } > > > > public const int POWER_NAME = 0x00000001; > > > > > > Code: > > private IntPtr _power_hold; > > > > On: > > _power_hold = SetPowerRequirement("BKL1:", > > CEDEVICE_POWER_STATE.D0, > > POWER_NAME, null, 0); > > Off: (should do error checking!) > > ReleasePowerRequirement(_power_hold); > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Use the Remote Registry Editor tool (off your Start Menu under Studio 05);
-- Chris Tacke OpenNETCF Consulting Managed Code in the Embedded World www.opennetcf.com -- <gwatts@phys.washington.edu> wrote in message news:1158177675.754468.204300@i3g2000cwc.googlegroups.com... > Hi, > Thanks! What is a decent registry editor? I didn't see one in the > stuff that cae in the SDK (or I just missed it). > > Cheers, > Gordon. > > <ctacke/> wrote: >> It's in the registry under HKLM\Drivers\Active >> >> -Chris >> >> >> <gwatts@phys.washington.edu> wrote in message >> news:1158118203.433940.111820@e3g2000cwe.googlegroups.com... >> > Hi, >> > I just did a great deal of searching to figure out that the device >> > name for the backlight is BKL1: (I've appended code if you want to keep >> > it on with the power manager). But it occurs to me that the backlight >> > device name is arbitrary. I'm just lucky my phone used the same name >> > (right?). Further, this must hold true for all devices. I'm curious. >> > How do I find out the names of all the devices known to my smartphone's >> > OS? >> > >> > Cheers, >> > Gordon. >> > >> > P.S. Code showing how to turn it on/off can be found >> > here:http://www.peterfoot.net/KeepYourSm...acklightOn.aspx (in >> > VB), Or in C# the code I ended up writing: >> > >> > [DllImport("coredll.dll")] >> > static extern bool PowerPolicyNotify( >> > UInt32 dwMessage, >> > UInt32 dwData >> > ); >> > >> > [DllImport("coredll.dll", SetLastError = true, >> > CharSet=CharSet.Unicode)] >> > static extern IntPtr SetPowerRequirement( >> > string device_name, >> > CEDEVICE_POWER_STATE DeviceState, >> > UInt32 DeviceFlags, >> > string pvSystemState, >> > UInt32 StateFlags); >> > >> > enum CEDEVICE_POWER_STATE : int >> > { >> > PwrDeviceUnspecified = -1, >> > D0 = 0, // Full on >> > D1, // Low power on, fully functional at low >> > D2, // Standby: partially owered with automatic wake >> > D3, // Sleep: partially powered with device initaited wake >> > D4, // Off: Unpowered. >> > PwrDeviceMaximum >> > } >> > >> > public const int POWER_NAME = 0x00000001; >> > >> > >> > Code: >> > private IntPtr _power_hold; >> > >> > On: >> > _power_hold = SetPowerRequirement("BKL1:", >> > CEDEVICE_POWER_STATE.D0, >> > POWER_NAME, null, 0); >> > Off: (should do error checking!) >> > ReleasePowerRequirement(_power_hold); >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

