KDECore
kkernel_win.cpp File Reference
#include "kkernel_win.h"
#include <config.h>
#include <QtCore/QBool>
#include <QtCore/QTextCodec>
#include "kglobal.h"
#include <klocale.h>
#include <QtCore/QDir>
#include <QtCore/QString>
#include <windows.h>
#include <shellapi.h>
#include <process.h>

Go to the source code of this file.
Defines | |
#define | FAILURE |
#define | WIN32_CAST_CHAR (LPCWSTR) |
Functions | |
BOOL WINAPI | DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) |
QString | getKde4Prefix () |
QByteArray | getWin32LocaleName () |
QString | getWin32RegistryValue (HKEY key, const QString &subKey, const QString &item, bool *ok=0) |
QString | getWin32ShellFoldersPath (const QString &folder) |
void | initKde4prefixUtf16 () |
bool | isExecutable (const QString &file) |
static void | kMessageConsoleOutput (QtMsgType type, const char *msg) |
static void | kMessageGuiOutput (QtMsgType type, const char *msg) |
bool | showWin32FilePropertyDialog (const QString &fileName) |
static int | subSystem () |
Variables | |
static QString * | kde4Prefix = NULL |
static wchar_t | kde4prefixUtf16 [MAX_PATH+2] |
static HINSTANCE | kdecoreDllInstance = NULL |
static class kMessageOutputInstaller | kMessageOutputInstallerInstance |
Define Documentation
#define FAILURE |
Value:
{ if (ok) \ *ok = false; \ return QString(); }
#define WIN32_CAST_CHAR (LPCWSTR) |
Definition at line 44 of file kkernel_win.cpp.
Function Documentation
BOOL WINAPI DllMain | ( | HINSTANCE | hinstDLL, | |
DWORD | fdwReason, | |||
LPVOID | lpReserved | |||
) |
The dll entry point - get the instance handle for GetModuleFleNameW Maybe also some special initialization / cleanup can be done here.
Definition at line 85 of file kkernel_win.cpp.
QString getKde4Prefix | ( | ) |
Definition at line 74 of file kkernel_win.cpp.
QByteArray getWin32LocaleName | ( | ) |
- Returns:
- two-letter locale name (like "en" or "pl") taken from MS Windows native registry. Useful when we don't want to rely on KSyCoCa. Used e.g. by kbuildsycoca application.
Definition at line 175 of file kkernel_win.cpp.
QString getWin32RegistryValue | ( | HKEY | key, | |
const QString & | subKey, | |||
const QString & | item, | |||
bool * | ok = 0 | |||
) |
- Returns:
- a value from MS Windows native registry.
- Parameters:
-
key is usually one of HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE constants defined in WinReg.h. subKey is a registry subkey defined as a path to a registry folder, eg. "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" ('\' delimiter must be used) item is an item inside subKey or "" if default folder's value should be returned ok if not null, will be set to true on success and false on failure
Definition at line 125 of file kkernel_win.cpp.
Windows-specific functions needed in kdecore.
- Returns:
- a value from MS Windows native registry for shell folder folder.
Definition at line 194 of file kkernel_win.cpp.
void initKde4prefixUtf16 | ( | ) |
Definition at line 51 of file kkernel_win.cpp.
bool isExecutable | ( | const QString & | filename | ) |
- Returns:
- true when the file is an executable on windows.
Definition at line 303 of file kkernel_win.cpp.
static void kMessageConsoleOutput | ( | QtMsgType | type, | |
const char * | msg | |||
) | [static] |
debug message printer for win32 console applications
Definition at line 235 of file kkernel_win.cpp.
static void kMessageGuiOutput | ( | QtMsgType | type, | |
const char * | msg | |||
) | [static] |
bool showWin32FilePropertyDialog | ( | const QString & | fileName | ) |
Shows native MS Windows file property dialog for a file fileName.
Return true on success. Only works for local absolute paths. Used by KPropertiesDialog, if possible.
Definition at line 159 of file kkernel_win.cpp.
static int subSystem | ( | ) | [static] |
retrieve type of win32 subsystem from the executable header
- Returns:
- type of win32 subsystem - the subsystem types are defined at http://msdn.microsoft.com/en-us/library/ms680339(VS.85).aspx
Definition at line 258 of file kkernel_win.cpp.
Variable Documentation
QString* kde4Prefix = NULL [static] |
Definition at line 49 of file kkernel_win.cpp.
wchar_t kde4prefixUtf16[MAX_PATH+2] [static] |
Definition at line 48 of file kkernel_win.cpp.
HINSTANCE kdecoreDllInstance = NULL [static] |
Definition at line 47 of file kkernel_win.cpp.
class kMessageOutputInstaller kMessageOutputInstallerInstance [static] |
setup win32 debug printer output
gui applications - uses OutputDebugString console applications - uses OutputDebugString and stderr
in both cases the message type is identified by a specific prefix string
TODO: report events to the windows event log system http://msdn.microsoft.com/en-us/library/aa363680(VS.85).aspx