return SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, bEnableDisable ? FALSE : TRUE, &bOldState, 0);
}
/***********************************
* Enable/Disable Alt+Tab, Alt+Esc *
* TRUE=Enable, FALSE=Disable *
* ( Win ?) *
***********************************/
int AltTab1_Enable_Disable(BOOL bEnableDisable)
{
BOOL bOldState;
return SystemParametersInfo(SPI_SETFASTTASKSWITCH, bEnableDisable ? FALSE : TRUE, &bOldState, 0);
// return SystemParametersInfo(SPI_SETSWITCHTASKDISABLE, bEnableDisable ? FALSE : TRUE, &bOldState, 0);
}
/***********************************
* Enable/Disable Alt+Tab, Alt+Esc *
* TRUE=Enable, FALSE=Disable *
* (Win 2K) *
***********************************/
int AltTab2_Enable_Disable(HWND hWnd, BOOL bEnableDisable)
{
#define m_nHotKeyID 100
if (!bEnableDisable)
{
if (!RegisterHotKey(hWnd, m_nHotKeyID+0, MOD_ALT, VK_TAB)) // Alt+Tab
return 0;
if (!RegisterHotKey(hWnd, m_nHotKeyID+1, MOD_ALT, VK_ESCAPE)) // Alt+Esc
return 0;
}
else
{
if (!UnregisterHotKey(hWnd, m_nHotKeyID+0))
return 0;
if (!UnregisterHotKey(hWnd, m_nHotKeyID+1))
return 0;
}
return 1;
}
/*****************************************************
* Enable/Disable task switching keys. *
* (Alt+Tab, Alt+Esc, Ctrl+Esc, Win, Ctrl+Shift+Esc) *
* TRUE=Enable, FALSE=Disable *
* (Win NT4SP3+, Win2K).