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.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file win32.h 00013 ** \version $Id: win32.h 3735 2009-04-28 20:28:01Z edmanm $ 00014 ** \brief Win32-specific functions 00015 */ 00016 00017 #ifndef _WIN32_H 00018 #define _WIN32_H 00019 00020 #include <QHash> 00021 #include <QString> 00022 00023 #define WIN32_LEAN_AND_MEAN 00024 #include <windows.h> 00025 00026 /** Retrieves the location of the user's %PROGRAMFILES% folder. */ 00027 QString win32_program_files_folder(); 00028 00029 /** Retrieves the location of the user's %APPDATA% folder. */ 00030 QString win32_app_data_folder(); 00031 00032 /** Returns value of keyName or empty QString if keyName doesn't exist */ 00033 QString win32_registry_get_key_value(QString keyLocation, QString keyName); 00034 00035 /** Creates and/or sets the key to the specified value */ 00036 void win32_registry_set_key_value(QString keyLocation, QString keyName, QString keyValue); 00037 00038 /** Removes the key from the registry if it exists */ 00039 void win32_registry_remove_key(QString keyLocation, QString keyName); 00040 00041 /** Returns a list of all currently active processes, including their pid 00042 * and exe filename. */ 00043 QHash<qint64, QString> win32_process_list(); 00044 00045 /** 00046 * Close all processes started from the specified filename. Sends 00047 * WM_QUIT to all top-level windows. Filename should be given in 00048 * lowercase, and comparison is case insensitive. Note: the MSDN 00049 * documentation for WM_QUIT states that the message should not be 00050 * sent by PostMessage(). However, sending WM_CLOSE leaves Firefox 00051 * running, whereas WM_QUIT seems to work. 00052 */ 00053 void win32_end_process_by_filename(QString filename); 00054 00055 #endif 00056