Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
MSWindowsScreenSaver.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
11
12#define WIN32_LEAN_AND_MEAN
13#include <Windows.h>
14
15class Thread;
16
19{
20public:
22 ~MSWindowsScreenSaver() override;
23
25
26
28
34 bool checkStarted(UINT msg, WPARAM, LPARAM);
35
37
38 // IScreenSaver overrides
39 void enable() override;
40 void disable() override;
41 void activate() override;
42 void deactivate() override;
43 bool isActive() const override;
44
45private:
46 class FindScreenSaverInfo
47 {
48 public:
49 HDESK m_desktop;
50 HWND m_window;
51 };
52
53 static BOOL CALLBACK killScreenSaverFunc(HWND hwnd, LPARAM lParam);
54
55 void watchDesktop();
56 void watchProcess(HANDLE process);
57 void unwatchProcess();
58 void watchDesktopThread(void *);
59 void watchProcessThread(void *);
60
61 void setSecure(bool secure, bool saveSecureAsInt);
62 bool isSecure(bool *wasSecureAnInt) const;
63
64private:
65 BOOL m_wasEnabled;
66 bool m_wasSecure = false;
67 bool m_wasSecureAnInt = false;
68
69 HANDLE m_process = nullptr;
70 Thread *m_watch = nullptr;
71 DWORD m_threadID = 0;
72 UINT m_msg = 0;
73 WPARAM m_wParam = 0;
74 LPARAM m_lParam = 0;
75
76 // checkActive state. true if the screen saver is being watched
77 // for deactivation (and is therefore active).
78 bool m_active = false;
79};
static const WSAEVENT FAR DWORD
Definition ArchNetworkWinsock.cpp:54
static const WSAEVENT FAR BOOL
Definition ArchNetworkWinsock.cpp:54
Screen saver interface.
Definition IScreenSaver.h:18
void disable() override
Disable screen saver.
Definition MSWindowsScreenSaver.cpp:92
void deactivate() override
Deactivate screen saver.
Definition MSWindowsScreenSaver.cpp:119
bool isActive() const override
Test if screen saver on.
Definition MSWindowsScreenSaver.cpp:149
MSWindowsScreenSaver()
Definition MSWindowsScreenSaver.cpp:32
void activate() override
Activate screen saver.
Definition MSWindowsScreenSaver.cpp:104
void enable() override
Enable screen saver.
Definition MSWindowsScreenSaver.cpp:82
~MSWindowsScreenSaver() override
Definition MSWindowsScreenSaver.cpp:38
bool checkStarted(UINT msg, WPARAM, LPARAM)
Check if screen saver started.
Definition MSWindowsScreenSaver.cpp:43
Thread handle.
Definition Thread.h:33