Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CMSWindowsScreenSaver.h

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

Generated on Fri Nov 6 00:21:14 2009 for synergy-plus by  doxygen 1.3.9.1