No screen protection and system hotkey, etc.

zhaozj2021-02-08  217

No screen protection and system hotkey, etc.

Author: Xu Jing Zhou

1. Prohibition / Enable screen protection and power management

Static uint dss_getlist [] = {SPI_GetLowPowerTimeout, SPI_GetPowerOfftimeout, SPI_GetScreensavetimeout};

Static uint DSS_SETLIST [] = {SPI_SETLOWPOWPOWPOWERTIMEOUT, SPI_SETPowerOfftimeout, SPI_SETSCREENSAVETIMEOUT};

Static const Int dss_listcount = _countof (DSS_GETLIST);

l Disable screen protection and power management

{

m_pvalue = new int [DSS_ListCount];

For (int x = 0; x

{

// Disable screen protection and power management

Verify (SystemParametersInfo (DSS_SETLIST [X], 0, NULL, 0));

}

delete [] m_pvalue;

}

l Enable screen protection and power management

{

m_pvalue = new int [DSS_ListCount];

For (int x = 0; x

{

// Enable screen protection and power management

Verify (SystemParametersInfo (DSS_SETLIST [X], M_PValue [x], NULL, 0));

}

delete [] m_pvalue;

}

2. Prohibit / enable system hotkey

Bool bold;

l Prohibition system hotkey

// Shield off the system key

SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, TRUE, & BOLD, SPIF_UPDATEINIFILE);

l Enable system hotkey

// Restore system hotkey

SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, FALSE, & BOLD, SPIF_UPDATEINIFILE);

3. Hide / Display Windows System Tasklets

l Hidden system taskbar

// Hide Windows System Task Bar

:: ShowWindow (:: FindWindow ("shell_traywnd", null), sw_hide;

l Display system taskbar

/ / Restore the Windows System Task Bar Normal Display

:: ShowWindow (:: FindWindow ("shell_trayWnd", null), sw_show;

Contact information:

Author email: jingzhou_xu@163.com

Future Studio (Future Studio)

转载请注明原文地址:https://www.9cbs.com/read-2112.html

New Post(0)