How to keep Monitor on permanently in XPE.

  • Thread starter Thread starter Joseph
  • Start date Start date
J

Joseph

I have a problem in XPE with the Power Scheme Setting of
Monitor. The XPE is customized to run in command shell
only. It turns off all monitors (There are three monitors
connected to the PC, using Matrox G450 dual head display
card) after the system has been idle for a specified
period of time, about 20 min. I know that this is related
to the power scheme setting of monitor.

For Windows XP, choosing "Presentation" as the Power
Scheme can keep both monitors, hard disks always turn on
and system never goes into standby mode. I thought the
same principle should be working to XPE and such setting
can be found in the component "Standard PC" in the Target
Analyzer. After the XPE is deployed, we checked the value
of registry key [HKEY_USERS\.DEFAULT\Control
Panel\PowerCfg\CurrentPowerPolicy] is also 2, which means
the current power scheme used in XPE is "Presentation".
Also, both APM and ACPI functions are enabled in the BIOS.
However, the monitor still turns off after the system has
been idle for about 20 min.

Does anyone get any idea to keep the monitor on
permanently?
 
I had the same problem.. Simulating mouse movement will keep the monitor
on..

I solved it by calling SendInput in user32.dll:

Input[0].Itype := INPUT_MOUSE;
Input[0].mi.dx := 65535;
Input[0].mi.dy := 65535;
Input[0].mi.dwFlags := MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE;
Input[0].mi.mouseData := 0;

Input[1].Itype := INPUT_MOUSE;
Input[1].mi.dx := 65534;
Input[1].mi.dy := 65534;
Input[1].mi.dwFlags := MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE;
Input[1].mi.mouseData := 0;

SendInput( length(Input), Input[0], SizeOf(TInput) );

Crude, but effective..

BN
 
Thx, I know I can solve it by using simulate a mouse or
keyboard event. But this is my last choice. I don't want
to interfere the system via software. Do u know other
method???

-----Original Message-----
I had the same problem.. Simulating mouse movement will keep the monitor
on..

I solved it by calling SendInput in user32.dll:

Input[0].Itype := INPUT_MOUSE;
Input[0].mi.dx := 65535;
Input[0].mi.dy := 65535;
Input[0].mi.dwFlags := MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE;
Input[0].mi.mouseData := 0;

Input[1].Itype := INPUT_MOUSE;
Input[1].mi.dx := 65534;
Input[1].mi.dy := 65534;
Input[1].mi.dwFlags := MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE;
Input[1].mi.mouseData := 0;

SendInput( length(Input), Input[0], SizeOf(TInput) );

Crude, but effective..

BN


"Joseph" <[email protected]> skrev i melding
I have a problem in XPE with the Power Scheme Setting of
Monitor. The XPE is customized to run in command shell
only. It turns off all monitors (There are three monitors
connected to the PC, using Matrox G450 dual head display
card) after the system has been idle for a specified
period of time, about 20 min. I know that this is related
to the power scheme setting of monitor.

For Windows XP, choosing "Presentation" as the Power
Scheme can keep both monitors, hard disks always turn on
and system never goes into standby mode. I thought the
same principle should be working to XPE and such setting
can be found in the component "Standard PC" in the Target
Analyzer. After the XPE is deployed, we checked the value
of registry key [HKEY_USERS\.DEFAULT\Control
Panel\PowerCfg\CurrentPowerPolicy] is also 2, which means
the current power scheme used in XPE is "Presentation".
Also, both APM and ACPI functions are enabled in the BIOS.
However, the monitor still turns off after the system has
been idle for about 20 min.

Does anyone get any idea to keep the monitor on
permanently?


.
 
At winlogon, that works...

Are you using Minlogon?
I recogniced that at minlogon, my monitor still goes offline at presentation

mario
 
Yes, I am Minilogon, I also observed that work in Winlogon.
-----Original Message-----
At winlogon, that works...

Are you using Minlogon?
I recogniced that at minlogon, my monitor still goes offline at presentation

mario



I have a problem in XPE with the Power Scheme Setting of
Monitor. The XPE is customized to run in command shell
only. It turns off all monitors (There are three monitors
connected to the PC, using Matrox G450 dual head display
card) after the system has been idle for a specified
period of time, about 20 min. I know that this is related
to the power scheme setting of monitor.

For Windows XP, choosing "Presentation" as the Power
Scheme can keep both monitors, hard disks always turn on
and system never goes into standby mode. I thought the
same principle should be working to XPE and such setting
can be found in the component "Standard PC" in the Target
Analyzer. After the XPE is deployed, we checked the value
of registry key [HKEY_USERS\.DEFAULT\Control
Panel\PowerCfg\CurrentPowerPolicy] is also 2, which means
the current power scheme used in XPE is "Presentation".
Also, both APM and ACPI functions are enabled in the BIOS.
However, the monitor still turns off after the system has
been idle for about 20 min.

Does anyone get any idea to keep the monitor on
permanently?


.
 
Hi Joseph,

I'm using Minlogon with my custom shell. From this shell I use the
Power Management Functions of the Platform SDK to setup the power
policy and it works fine. Take a look at this code:


if(CanUserWritePwrScheme() == FALSE) AfxMessageBox("ERROR:
CanUserWritePwrScheme");
else
{
// Get the Active Power Scheme
UINT iPwrSchemeID;
if(GetActivePwrScheme(&iPwrSchemeID) == 0) AfxMessageBox("ERROR:
GetActivePwrScheme");
else
{
POWER_POLICY PowerPolicy;
if(ReadPwrScheme(iPwrSchemeID,&PowerPolicy) == 0) AfxMessageBox("ERROR:
ReadPwrScheme");
else
{
// Set VideoTimeout to NEVER
PowerPolicy.user.VideoTimeoutAc = 0;
PowerPolicy.user.VideoTimeoutDc = 0;

if(WritePwrScheme(&iPwrSchemeID,(LPTSTR)"",(LPTSTR)"",&PowerPolicy) ==
0)
AfxMessageBox("ERROR: WritePwrScheme");
else
{
// Set Global Power Policy to dissable power button and so on
GLOBAL_POWER_POLICY GlobalPowerPolicy;
if(ReadGlobalPwrPolicy(&GlobalPowerPolicy) == FALSE)
AfxMessageBox("ERROR: ReadGlobalPwrPolicy");
else
{
GlobalPowerPolicy.user.PowerButtonAc.Action = PowerActionNone;
GlobalPowerPolicy.user.PowerButtonDc.Action = PowerActionNone;
GlobalPowerPolicy.user.SleepButtonAc.Action = PowerActionNone;
GlobalPowerPolicy.user.SleepButtonDc.Action = PowerActionNone;
GlobalPowerPolicy.user.LidCloseAc.Action = PowerActionNone;
GlobalPowerPolicy.user.LidCloseDc.Action = PowerActionNone;
GlobalPowerPolicy.user.GlobalFlags = (ULONG) 0;

if(WriteGlobalPwrPolicy(&GlobalPowerPolicy) == FALSE)
AfxMessageBox("ERROR: WriteGlobalPwrPolicy");

if(SetActivePwrScheme(iPwrSchemeID,&GlobalPowerPolicy,NULL) == 0)
AfxMessageBox("ERROR: SetActivePwrScheme");
}
}
}
}
}


HTH,

Miquel Blasco



Joseph said:
I have a problem in XPE with the Power Scheme Setting of
Monitor. The XPE is customized to run in command shell
only. It turns off all monitors (There are three monitors
connected to the PC, using Matrox G450 dual head display
card) after the system has been idle for a specified
period of time, about 20 min. I know that this is related
to the power scheme setting of monitor.

For Windows XP, choosing "Presentation" as the Power
Scheme can keep both monitors, hard disks always turn on
and system never goes into standby mode. I thought the
same principle should be working to XPE and such setting
can be found in the component "Standard PC" in the Target
Analyzer. After the XPE is deployed, we checked the value
of registry key [HKEY_USERS\.DEFAULT\Control
Panel\PowerCfg\CurrentPowerPolicy] is also 2, which means
the current power scheme used in XPE is "Presentation".
Also, both APM and ACPI functions are enabled in the BIOS.
However, the monitor still turns off after the system has
been idle for about 20 min.

Does anyone get any idea to keep the monitor on
permanently?
 
Joseph,

I was never aware of this problem, but this is probably because in main loop
of my driver thread I'm calling:

PoSetSystemState(ES_USER_PRESENT | ES_DISPLAY_REQUIRED |
ES_SYSTEM_REQUIRED);

You can use similar call in user mode.
SetThreadExecutionState

This is better than to fake mouse moves. You just inform OS that you still
need some of it's resources.

Best regards,
Slobodan
 
Back
Top