Vidalia 0.2.15
|
00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 00007 ** including this file, may be copied, modified, propagated, or distributed 00008 ** except according to the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file win32.h 00013 ** \brief Win32-specific functions 00014 */ 00015 00016 #ifndef _WIN32_H 00017 #define _WIN32_H 00018 00019 #include <QHash> 00020 #include <QString> 00021 00022 #define WIN32_LEAN_AND_MEAN 00023 #include <windows.h> 00024 00025 /** Retrieves the location of the user's %PROGRAMFILES% folder. */ 00026 QString win32_program_files_folder(); 00027 00028 /** Retrieves the location of the user's %APPDATA% folder. */ 00029 QString win32_app_data_folder(); 00030 00031 /** Returns value of keyName or empty QString if keyName doesn't exist */ 00032 QString win32_registry_get_key_value(QString keyLocation, QString keyName); 00033 00034 /** Creates and/or sets the key to the specified value */ 00035 void win32_registry_set_key_value(QString keyLocation, QString keyName, QString keyValue); 00036 00037 /** Removes the key from the registry if it exists */ 00038 void win32_registry_remove_key(QString keyLocation, QString keyName); 00039 00040 /** Returns a list of all currently active processes, including their pid 00041 * and exe filename. */ 00042 QHash<qint64, QString> win32_process_list(); 00043 00044 /** 00045 * Close all processes started from the specified filename. Sends 00046 * WM_QUIT to all top-level windows. Filename should be given in 00047 * lowercase, and comparison is case insensitive. Note: the MSDN 00048 * documentation for WM_QUIT states that the message should not be 00049 * sent by PostMessage(). However, sending WM_CLOSE leaves Firefox 00050 * running, whereas WM_QUIT seems to work. 00051 */ 00052 void win32_end_process_by_filename(QString filename); 00053 00054 #endif 00055