~ubuntu-branches/ubuntu/natty/synergy/natty

« back to all changes in this revision

Viewing changes to lib/arch/CArchMiscWindows.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Kern
  • Date: 2006-04-24 23:13:23 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060424231323-40ww9td3rzlxu3dc
Tags: 1.3.1-1ubuntu1
Adapted the package to the new X hierarchy which adheres to the FHS

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
CArchMiscWindows::CDialogs* CArchMiscWindows::s_dialogs   = NULL;
34
34
DWORD                                           CArchMiscWindows::s_busyState = 0;
35
35
CArchMiscWindows::STES_t        CArchMiscWindows::s_stes      = NULL;
 
36
HICON                                           CArchMiscWindows::s_largeIcon = NULL;
 
37
HICON                                           CArchMiscWindows::s_smallIcon = NULL;
36
38
 
37
39
void
38
40
CArchMiscWindows::init()
87
89
        return result;
88
90
}
89
91
 
 
92
void
 
93
CArchMiscWindows::setIcons(HICON largeIcon, HICON smallIcon)
 
94
{
 
95
        s_largeIcon = largeIcon;
 
96
        s_smallIcon = smallIcon;
 
97
}
 
98
 
 
99
void
 
100
CArchMiscWindows::getIcons(HICON& largeIcon, HICON& smallIcon)
 
101
{
 
102
        largeIcon = s_largeIcon;
 
103
        smallIcon = s_smallIcon;
 
104
}
 
105
 
90
106
int
91
107
CArchMiscWindows::runDaemon(RunFunc runFunc)
92
108
{
114
130
HKEY
115
131
CArchMiscWindows::openKey(HKEY key, const TCHAR* keyName)
116
132
{
 
133
        return openKey(key, keyName, false);
 
134
}
 
135
 
 
136
HKEY
 
137
CArchMiscWindows::openKey(HKEY key, const TCHAR* const* keyNames)
 
138
{
 
139
        return openKey(key, keyNames, false);
 
140
}
 
141
 
 
142
HKEY
 
143
CArchMiscWindows::addKey(HKEY key, const TCHAR* keyName)
 
144
{
 
145
        return openKey(key, keyName, true);
 
146
}
 
147
 
 
148
HKEY
 
149
CArchMiscWindows::addKey(HKEY key, const TCHAR* const* keyNames)
 
150
{
 
151
        return openKey(key, keyNames, true);
 
152
}
 
153
 
 
154
HKEY
 
155
CArchMiscWindows::openKey(HKEY key, const TCHAR* keyName, bool create)
 
156
{
117
157
        // ignore if parent is NULL
118
158
        if (key == NULL) {
119
159
                return NULL;
123
163
        HKEY newKey;
124
164
        LONG result = RegOpenKeyEx(key, keyName, 0,
125
165
                                                                KEY_WRITE | KEY_QUERY_VALUE, &newKey);
126
 
        if (result != ERROR_SUCCESS) {
 
166
        if (result != ERROR_SUCCESS && create) {
127
167
                DWORD disp;
128
168
                result = RegCreateKeyEx(key, keyName, 0, TEXT(""),
129
169
                                                                0, KEY_WRITE | KEY_QUERY_VALUE,
140
180
}
141
181
 
142
182
HKEY
143
 
CArchMiscWindows::openKey(HKEY key, const TCHAR* const* keyNames)
 
183
CArchMiscWindows::openKey(HKEY key, const TCHAR* const* keyNames, bool create)
144
184
{
145
185
        for (size_t i = 0; key != NULL && keyNames[i] != NULL; ++i) {
146
186
                // open next key
147
 
                key = openKey(key, keyNames[i]);
 
187
                key = openKey(key, keyNames[i], create);
148
188
        }
149
189
        return key;
150
190
}