Advertisement
Advertisement
| 02.12.2008 at 07:17PM PST, ID: 23158586 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: |
// IdleTime.cpp : Defines the entry point for the console application.
//
#include "stdafx.h";
#include "powrprof.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double tickCount;
double idleCount;
LASTINPUTINFO lpi;
lpi.cbSize = sizeof(LASTINPUTINFO);
if (!GetLastInputInfo(&lpi))
{
// failed, use GetLastError to get error code
}
// lpi.dwTime now holds the tick count when last input was made
//cout << lpi.dwTime << endl;
tickCount = GetTickCount();
idleCount = ( tickCount - lpi.dwTime );
cout << idleCount / 1000 << endl;
//GLOBAL_POWER_POLICY CurrentGP;
//POWER_POLICY CurrentPP;
//UINT id;
//GetActivePwrScheme(&id); //capture id of current scheme
//GetCurrentPowerPolicies(&CurrentGP,&CurrentPP); //get active policies
////if(CanUserWritePwrScheme() == FALSE) {cout << "no";};
GLOBAL_POWER_POLICY CurrentGP;
POWER_POLICY CurrentPP;
ULONG savVidAC,savVidDC;
UINT id;
UINT ssav;
GetActivePwrScheme(&id); //capture id of current scheme
GetCurrentPowerPolicies(&CurrentGP,&CurrentPP); //get active policies
savVidAC = CurrentPP.user.VideoTimeoutAc; //save current values
savVidDC = CurrentPP.user.VideoTimeoutDc;
CurrentPP.user.VideoTimeoutAc = 15; //disallow display shutoff
CurrentPP.user.VideoTimeoutDc = 14;
//set new values. Not sure how to save values
SetCurrentPowerPolicies(id,CurrentGP,&CurrentPP); //set new values
// get error: Error 1 error C3861: 'SetCurrentPowerPolicies': identifier not found
// c:\Programming\PowerManagement\SetPMSettingsCPlusPlus\IdleTime\IdleTime.cpp 50
//SystemParametersInfo (SPI_GETSCREENSAVETIMEOUT,0,&ssav,0); //save current value
//SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,0,NULL,0); //turn off screen saver
return 0;
}
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 02.12.2008 at 07:52PM PST, ID: 20881508 |
| 02.13.2008 at 12:25PM PST, ID: 20887797 |
| 02.13.2008 at 12:28PM PST, ID: 20887830 |
1: |
WriteGlobalPwrPolicy(&CurrentGP); |
| 02.13.2008 at 01:29PM PST, ID: 20888413 |
| 02.13.2008 at 01:38PM PST, ID: 20888505 |
| 02.13.2008 at 02:16PM PST, ID: 20888932 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: |
// IdleTime.cpp : Defines the entry point for the console application.
//
#include "stdafx.h";
#include "powrprof.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double tickCount;
double idleCount;
LASTINPUTINFO lpi;
lpi.cbSize = sizeof(LASTINPUTINFO);
if (!GetLastInputInfo(&lpi))
{
// failed, use GetLastError to get error code
}
// lpi.dwTime now holds the tick count when last input was made
//cout << lpi.dwTime << endl;
tickCount = GetTickCount();
idleCount = ( tickCount - lpi.dwTime );
cout << idleCount / 1000 << endl;
//GLOBAL_POWER_POLICY CurrentGP;
//POWER_POLICY CurrentPP;
//UINT id;
//GetActivePwrScheme(&id); //capture id of current scheme
//GetCurrentPowerPolicies(&CurrentGP,&CurrentPP); //get active policies
////if(CanUserWritePwrScheme() == FALSE) {cout << "no";};
GLOBAL_POWER_POLICY CurrentGP;
POWER_POLICY CurrentPP;
ULONG savVidAC,savVidDC;
UINT id;
//UINT ssav;
GetActivePwrScheme(&id); //capture id of current scheme
GetCurrentPowerPolicies(&CurrentGP,&CurrentPP); //get active policies
savVidAC = CurrentPP.user.VideoTimeoutAc; //save current values
savVidDC = CurrentPP.user.VideoTimeoutDc;
CurrentPP.user.VideoTimeoutAc = 15;
CurrentPP.user.VideoTimeoutDc = 14;
//set new values. Not sure how to save values
WritePwrScheme(id,"test1","test1",&CurrentPP);
WriteGlobalPwrPolicy(&CurrentGP);
//SetCurrentPowerPolicies(id,CurrentGP,&CurrentPP); //set new values
// get error: Error 1 error C3861: 'SetCurrentPowerPolicies': identifier not found
// c:\Programming\PowerManagement\SetPMSettingsCPlusPlus\IdleTime\IdleTime.cpp 50
//SystemParametersInfo (SPI_GETSCREENSAVETIMEOUT,0,&ssav,0); //save current value
//SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,0,NULL,0); //turn off screen saver
return 0;
}
|
| 02.13.2008 at 02:20PM PST, ID: 20888960 |
| 02.13.2008 at 03:18PM PST, ID: 20889456 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: |
unsigned int ps; unsigned int timeout; POWER_POLICY pp; timeout = 5; GetActivePwrScheme(&id); ReadPwrScheme(ps, &pp); pp.user.VideoTimeoutAc = timeout; SetActivePwrScheme(ps, 0, &pp); |
| 02.13.2008 at 04:03PM PST, ID: 20889739 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: |
POWER_POLICY CurrentPowerPolicy; UINT psIdx = 0; #define TEST_VALUE_AC 7200 #define TEST_VALUE_DC 7200 GetActivePwrScheme(&psIdx); ReadPwrScheme(psIdx, &CurrentPowerPolicy); CurrentPowerPolicy.user.VideoTimeoutAc = TEST_VALUE_AC; CurrentPowerPolicy.user.VideoTimeoutDc = TEST_VALUE_DC; WritePwrScheme(&psIdx,NULL,NULL, &CurrentPowerPolicy); SetActivePwrScheme(psIdx, NULL, NULL); |