• Main Page
  • Classes
  • Files
  • File List

CMSWindowsScreenSaver.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2002 Chris Schoeneman
00005  * 
00006  * This package is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * found in the file COPYING that should have accompanied this file.
00009  * 
00010  * This package is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #ifndef CMSWINDOWSSCREENSAVER_H
00020 #define CMSWINDOWSSCREENSAVER_H
00021 
00022 #include "IScreenSaver.h"
00023 #include "CString.h"
00024 #define WIN32_LEAN_AND_MEAN
00025 #include <windows.h>
00026 
00027 class CThread;
00028 
00030 class CMSWindowsScreenSaver : public IScreenSaver {
00031 public:
00032     CMSWindowsScreenSaver();
00033     virtual ~CMSWindowsScreenSaver();
00034 
00036 
00037 
00039 
00045     bool                checkStarted(UINT msg, WPARAM, LPARAM);
00046 
00048 
00049     // IScreenSaver overrides
00050     virtual void        enable();
00051     virtual void        disable();
00052     virtual void        activate();
00053     virtual void        deactivate();
00054     virtual bool        isActive() const;
00055 
00056 private:
00057     class CFindScreenSaverInfo {
00058     public:
00059         HDESK           m_desktop;
00060         HWND            m_window;
00061     };
00062 
00063     static BOOL CALLBACK    findScreenSaverFunc(HWND hwnd, LPARAM lParam);
00064     static BOOL CALLBACK    killScreenSaverFunc(HWND hwnd, LPARAM lParam);
00065 
00066     DWORD               findScreenSaver();
00067     void                watchDesktop();
00068     void                watchProcess(HANDLE process);
00069     void                unwatchProcess();
00070     void                watchDesktopThread(void*);
00071     void                watchProcessThread(void*);
00072 
00073     void                setSecure(bool secure, bool saveSecureAsInt);
00074     bool                isSecure(bool* wasSecureAnInt) const;
00075 
00076 private:
00077     bool                m_is95Family;
00078     bool                m_is95;
00079     bool                m_isNT;
00080     BOOL                m_wasEnabled;
00081     bool                m_wasSecure;
00082     bool                m_wasSecureAnInt;
00083 
00084     HANDLE              m_process;
00085     CThread*            m_watch;
00086     DWORD               m_threadID;
00087     UINT                m_msg;
00088     WPARAM              m_wParam;
00089     LPARAM              m_lParam;
00090 
00091     // checkActive state.  true if the screen saver is being watched
00092     // for deactivation (and is therefore active).
00093     bool                m_active;
00094 };
00095 
00096 #endif

Generated on Sat May 25 2013 00:00:04 for Synergy by  doxygen 1.7.1