mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: better screensaver defeating.
This commit is contained in:
parent
2b8d19edaf
commit
96ca3fbaf4
1 changed files with 4 additions and 30 deletions
|
|
@ -2965,19 +2965,11 @@ public:
|
|||
{
|
||||
if (Process::isForegroundProcess())
|
||||
{
|
||||
// simulate a shift key getting pressed..
|
||||
INPUT input[2];
|
||||
input[0].type = INPUT_KEYBOARD;
|
||||
input[0].ki.wVk = VK_SHIFT;
|
||||
input[0].ki.dwFlags = 0;
|
||||
input[0].ki.dwExtraInfo = 0;
|
||||
INPUT input = { 0 };
|
||||
input.type = INPUT_MOUSE;
|
||||
input.mi.mouseData = MOUSEEVENTF_MOVE;
|
||||
|
||||
input[1].type = INPUT_KEYBOARD;
|
||||
input[1].ki.wVk = VK_SHIFT;
|
||||
input[1].ki.dwFlags = KEYEVENTF_KEYUP;
|
||||
input[1].ki.dwExtraInfo = 0;
|
||||
|
||||
SendInput (2, input, sizeof (INPUT));
|
||||
SendInput (1, &input, sizeof (INPUT));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -2997,24 +2989,6 @@ bool Desktop::isScreenSaverEnabled()
|
|||
return screenSaverDefeater == nullptr;
|
||||
}
|
||||
|
||||
/* (The code below is the "correct" way to disable the screen saver, but it
|
||||
completely fails on winXP when the saver is password-protected...)
|
||||
|
||||
static bool juce_screenSaverEnabled = true;
|
||||
|
||||
void Desktop::setScreenSaverEnabled (const bool isEnabled) noexcept
|
||||
{
|
||||
juce_screenSaverEnabled = isEnabled;
|
||||
SetThreadExecutionState (isEnabled ? ES_CONTINUOUS
|
||||
: (ES_DISPLAY_REQUIRED | ES_CONTINUOUS));
|
||||
}
|
||||
|
||||
bool Desktop::isScreenSaverEnabled() noexcept
|
||||
{
|
||||
return juce_screenSaverEnabled;
|
||||
}
|
||||
*/
|
||||
|
||||
//==============================================================================
|
||||
void LookAndFeel::playAlertSound()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue