Software Development Network>> Smart Devicet>> Remapping POWER button
Hi,
I have tried this, but when my Mio A701 switches off after 1 minute of idle time (enabled in power manager), all apps stop running.
I have changed the "SuspendToUnattendedMode" from 0 to 1 in the registry. That makes no difference.
I have produced this C# code:
public enum PowerMode{ReevaluateStat = 0x0001,PowerChange = 0x0002,UnattendedMode = 0x0003,SuspendKeyOrPwrButtonPressed = 0x0004,SuspendKeyReleased = 0x0005,AppButtonPressed = 0x0006}
[
On start of app:PowerManagement.PowerPolicyNotify(PowerManagement.PowerMode.UnattendedMode, 1);
On end of app:PowerManagement.PowerPolicyNotify(PowerManagement.PowerMode.UnattendedMode, 0);
My application still seems to stop running when the device "switches" off due to idle on the battery.
I need my application to remain running in unattended mode when the screen switches off.
Using .Net CF2, VS2005, WM5 on a Mio A701.
Hi
I have been testing my applications using PlaySound(....)
PlaySound will work in Unattended mode so you can hear
what happens or what is happening..
One good way to test your apps is to use the WM5 Emulator.
I found that if the Emulator works, the Hardware MAY NOT
function the same because of implementation problems.
The Emulator is the reference standard.
Allan
You do not remap the power button - instead you should use PM API:
PowerPolicyNotify(PPN_UNATTENDEDMODE, TRUE);
to ensure that your application keeps running even after power button has been pressed
Hello,
I tried to use this code in my c# project but it doesn't work, have anyone been able to use PowerPolicyNotify in c#
// Mikael
Mike12 wrote: Hi, I have tried this, but when my Mio A701 switches off after 1 minute of idle time (enabled in power manager), all apps stop running. I have changed the "SuspendToUnattendedMode" from 0 to 1 in the registry. That makes no difference. I have produced this C# code: public enum PowerMode{ReevaluateStat = 0x0001,PowerChange = 0x0002,UnattendedMode = 0x0003,SuspendKeyOrPwrButtonPressed = 0x0004,SuspendKeyReleased = 0x0005,AppButtonPressed = 0x0006} [DllImport("CoreDll.dll")]public static extern void PowerPolicyNotify(PowerMode powermode, int flags); On start of app:PowerManagement.PowerPolicyNotify(PowerManagement.PowerMode.UnattendedMode, 1); On end of app:PowerManagement.PowerPolicyNotify(PowerManagement.PowerMode.UnattendedMode, 0); My application still seems to stop running when the device "switches" off due to idle on the battery. I need my application to remain running in unattended mode when the screen switches off. Using .Net CF2, VS2005, WM5 on a Mio A701.
Remapping POWER button
Vishal_LogicaCMG
Hi,
I have tried this, but when my Mio A701 switches off after 1 minute of idle time (enabled in power manager), all apps stop running.
I have changed the "SuspendToUnattendedMode" from 0 to 1 in the registry. That makes no difference.
I have produced this C# code:
public enum PowerMode
{
ReevaluateStat = 0x0001,
PowerChange = 0x0002,
UnattendedMode = 0x0003,
SuspendKeyOrPwrButtonPressed = 0x0004,
SuspendKeyReleased = 0x0005,
AppButtonPressed = 0x0006
}
[
DllImport("CoreDll.dll")]public static extern void PowerPolicyNotify(PowerMode powermode, int flags);
On start of app:
PowerManagement.PowerPolicyNotify(PowerManagement.PowerMode.UnattendedMode, 1);
On end of app:
PowerManagement.PowerPolicyNotify(PowerManagement.PowerMode.UnattendedMode, 0);
My application still seems to stop running when the device "switches" off due to idle on the battery.
I need my application to remain running in unattended mode when the screen switches off.
Using .Net CF2, VS2005, WM5 on a Mio A701.
Big5824
Hi
I have been testing my applications using PlaySound(....)
PlaySound will work in Unattended mode so you can hear
what happens or what is happening..
One good way to test your apps is to use the WM5 Emulator.
I found that if the Emulator works, the Hardware MAY NOT
function the same because of implementation problems.
The Emulator is the reference standard.
Allan
OasisGames
Muzero
NJCoughlan
You do not remap the power button - instead you should use PM API:
PowerPolicyNotify(PPN_UNATTENDEDMODE, TRUE);
to ensure that your application keeps running even after power button has been pressed
William Nordgren
Hello,
I tried to use this code in my c# project but it doesn't work, have anyone been able to use PowerPolicyNotify in c#
// Mikael