~nobuto/ubuntu/natty/synergy/merge-from-experimental

« back to all changes in this revision

Viewing changes to lib/arch/CArchMiscWindows.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Lutz
  • Date: 2003-10-31 19:36:30 UTC
  • Revision ID: james.westby@ubuntu.com-20031031193630-knbv79x5az7qh49y
Tags: upstream-1.0.14
ImportĀ upstreamĀ versionĀ 1.0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * synergy -- mouse and keyboard sharing utility
 
3
 * Copyright (C) 2002 Chris Schoeneman
 
4
 * 
 
5
 * This package is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * found in the file COPYING that should have accompanied this file.
 
8
 * 
 
9
 * This package is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 */
 
14
 
 
15
#ifndef CARCHMISCWINDOWS_H
 
16
#define CARCHMISCWINDOWS_H
 
17
 
 
18
#define WIN32_LEAN_AND_MEAN
 
19
 
 
20
#include "common.h"
 
21
#include "stdstring.h"
 
22
#include <windows.h>
 
23
 
 
24
//! Miscellaneous win32 functions.
 
25
class CArchMiscWindows {
 
26
public:
 
27
        typedef int                     (*RunFunc)(void);
 
28
 
 
29
        //! Test if windows 95, et al.
 
30
        /*!
 
31
        Returns true iff the platform is win95/98/me.
 
32
        */
 
33
        static bool                     isWindows95Family();
 
34
 
 
35
        //! Run the daemon
 
36
        /*!
 
37
        Delegates to CArchDaemonWindows.
 
38
        */
 
39
        static int                      runDaemon(RunFunc runFunc);
 
40
 
 
41
        //! Indicate daemon is in main loop
 
42
        /*!
 
43
        Delegates to CArchDaemonWindows.
 
44
        */
 
45
        static void                     daemonRunning(bool running);
 
46
 
 
47
        //! Indicate failure of running daemon
 
48
        /*!
 
49
        Delegates to CArchDaemonWindows.
 
50
        */
 
51
        static void                     daemonFailed(int result);
 
52
 
 
53
        //! Open and return a registry key, closing the parent key
 
54
        static HKEY                     openKey(HKEY parent, const TCHAR* child);
 
55
 
 
56
        //! Open and return a registry key, closing the parent key
 
57
        static HKEY                     openKey(HKEY parent, const TCHAR* const* keyPath);
 
58
 
 
59
        //! Close a key
 
60
        static void                     closeKey(HKEY);
 
61
 
 
62
        //! Delete a key (which should have no subkeys)
 
63
        static void                     deleteKey(HKEY parent, const TCHAR* name);
 
64
 
 
65
        //! Delete a value
 
66
        static void                     deleteValue(HKEY parent, const TCHAR* name);
 
67
 
 
68
        //! Test if a value exists
 
69
        static bool                     hasValue(HKEY key, const TCHAR* name);
 
70
 
 
71
        //! Set a string value in the registry
 
72
        static void                     setValue(HKEY key, const TCHAR* name,
 
73
                                                        const std::string& value);
 
74
 
 
75
        //! Set a DWORD value in the registry
 
76
        static void                     setValue(HKEY key, const TCHAR* name, DWORD value);
 
77
 
 
78
        //! Read a string value from the registry
 
79
        static std::string      readValueString(HKEY, const TCHAR* name);
 
80
 
 
81
        //! Read a DWORD value from the registry
 
82
        static DWORD            readValueInt(HKEY, const TCHAR* name);
 
83
};
 
84
 
 
85
#endif