Vidalia  0.3.1
win32.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file win32.h
13 ** \brief Win32-specific functions
14 */
15 
16 #ifndef _WIN32_H
17 #define _WIN32_H
18 
19 #include <QHash>
20 #include <QString>
21 
22 #define WIN32_LEAN_AND_MEAN
23 #include <windows.h>
24 
25 /** Retrieves the location of the user's %PROGRAMFILES% folder. */
27 
28 /** Retrieves the location of the user's %APPDATA% folder. */
29 QString win32_app_data_folder();
30 
31 /** Returns value of keyName or empty QString if keyName doesn't exist */
32 QString win32_registry_get_key_value(QString keyLocation, QString keyName);
33 
34 /** Creates and/or sets the key to the specified value */
35 void win32_registry_set_key_value(QString keyLocation, QString keyName, QString keyValue);
36 
37 /** Removes the key from the registry if it exists */
38 void win32_registry_remove_key(QString keyLocation, QString keyName);
39 
40 /** Returns a list of all currently active processes, including their pid
41  * and exe filename. */
42 QHash<qint64, QString> win32_process_list();
43 
44 /**
45  * Close all processes started from the specified filename. Sends
46  * WM_QUIT to all top-level windows. Filename should be given in
47  * lowercase, and comparison is case insensitive. Note: the MSDN
48  * documentation for WM_QUIT states that the message should not be
49  * sent by PostMessage(). However, sending WM_CLOSE leaves Firefox
50  * running, whereas WM_QUIT seems to work.
51  */
52 void win32_end_process_by_filename(QString filename);
53 
54 #endif
55 
QHash< qint64, QString > win32_process_list()
Definition: win32.cpp:228
QString win32_registry_get_key_value(QString keyLocation, QString keyName)
Definition: win32.cpp:95
void win32_registry_set_key_value(QString keyLocation, QString keyName, QString keyValue)
Definition: win32.cpp:119
void win32_end_process_by_filename(QString filename)
Definition: win32.cpp:203
QString win32_app_data_folder()
Definition: win32.cpp:86
QString win32_program_files_folder()
Definition: win32.cpp:78
void win32_registry_remove_key(QString keyLocation, QString keyName)
Definition: win32.cpp:146