win32.h

Go to the documentation of this file.
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 3527 2009-02-16 23:28:41Z sjmurdoch $
00014 ** \brief Win32-specific functions
00015 */
00016 
00017 #ifndef _WIN32_H
00018 #define _WIN32_H
00019 
00020 #define WIN32_LEAN_AND_MEAN
00021 #include <windows.h>
00022 #include <QHash>
00023 #include <QString>
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 

Generated on Wed Dec 23 21:06:55 2009 for Vidalia by  doxygen 1.6.1