Public Types | Static Public Member Functions

CArchMiscWindows Class Reference

Miscellaneous win32 functions. More...

#include <CArchMiscWindows.h>

List of all members.

Public Types

enum  EValueType {
  kUNKNOWN, kNO_VALUE, kUINT, kSTRING,
  kBINARY
}
enum  EBusyModes { kIDLE = 0x0000, kSYSTEM = 0x0001, kDISPLAY = 0x0002 }
typedef int(* RunFunc )(void)

Static Public Member Functions

static void init ()
 Initialize.
static void cleanup ()
 Delete memory.
static bool isWindows95Family ()
 Test if windows 95, et al.
static bool isWindowsModern ()
 Test if windows 95, et al.
static void setIcons (HICON largeIcon, HICON smallIcon)
static void getIcons (HICON &largeIcon, HICON &smallIcon)
static int runDaemon (RunFunc runFunc)
 Run the daemon.
static void daemonRunning (bool running)
 Indicate daemon is in main loop.
static void daemonFailed (int result)
 Indicate failure of running daemon.
static UINT getDaemonQuitMessage ()
 Get daemon quit message.
static HKEY openKey (HKEY parent, const TCHAR *child)
 Open and return a registry key, closing the parent key.
static HKEY openKey (HKEY parent, const TCHAR *const *keyPath)
 Open and return a registry key, closing the parent key.
static HKEY addKey (HKEY parent, const TCHAR *child)
 Open/create and return a registry key, closing the parent key.
static HKEY addKey (HKEY parent, const TCHAR *const *keyPath)
 Open/create and return a registry key, closing the parent key.
static void closeKey (HKEY)
 Close a key.
static void deleteKey (HKEY parent, const TCHAR *name)
 Delete a key (which should have no subkeys).
static void deleteValue (HKEY parent, const TCHAR *name)
 Delete a value.
static bool hasValue (HKEY key, const TCHAR *name)
 Test if a value exists.
static EValueType typeOfValue (HKEY key, const TCHAR *name)
 Get type of value.
static void setValue (HKEY key, const TCHAR *name, const std::string &value)
 Set a string value in the registry.
static void setValue (HKEY key, const TCHAR *name, DWORD value)
 Set a DWORD value in the registry.
static void setValueBinary (HKEY key, const TCHAR *name, const std::string &value)
 Set a BINARY value in the registry.
static std::string readValueString (HKEY, const TCHAR *name)
 Read a string value from the registry.
static DWORD readValueInt (HKEY, const TCHAR *name)
 Read a DWORD value from the registry.
static std::string readValueBinary (HKEY, const TCHAR *name)
 Read a BINARY value from the registry.
static void addDialog (HWND)
 Add a dialog.
static void removeDialog (HWND)
 Remove a dialog.
static bool processDialog (MSG *)
 Process dialog message.
static void addBusyState (DWORD busyModes)
 Disable power saving.
static void removeBusyState (DWORD busyModes)
 Enable power saving.
static void wakeupDisplay ()
 Briefly interrupt power saving.
static bool wasLaunchedAsService ()
 Returns true if this process was launched via NT service host.
static bool getParentProcessName (CString &name)
 Returns true if we got the parent process name.
static HINSTANCE instanceWin32 ()
static void setInstanceWin32 (HINSTANCE instance)
static BOOL WINAPI getProcessEntry (PROCESSENTRY32 &entry, DWORD processID)
static BOOL WINAPI getSelfProcessEntry (PROCESSENTRY32 &entry)
static BOOL WINAPI getParentProcessEntry (PROCESSENTRY32 &entry)

Detailed Description

Miscellaneous win32 functions.

Definition at line 32 of file CArchMiscWindows.h.


Member Function Documentation

void CArchMiscWindows::daemonFailed ( int  result  )  [static]

Indicate failure of running daemon.

Delegates to CArchDaemonWindows.

Definition at line 140 of file CArchMiscWindows.cpp.

void CArchMiscWindows::daemonRunning ( bool  running  )  [static]

Indicate daemon is in main loop.

Delegates to CArchDaemonWindows.

Definition at line 134 of file CArchMiscWindows.cpp.

UINT CArchMiscWindows::getDaemonQuitMessage (  )  [static]

Get daemon quit message.

Delegates to CArchDaemonWindows.

Definition at line 146 of file CArchMiscWindows.cpp.

void CArchMiscWindows::getIcons ( HICON &  largeIcon,
HICON &  smallIcon 
) [static]

Get the application icons.

Definition at line 121 of file CArchMiscWindows.cpp.

bool CArchMiscWindows::isWindows95Family (  )  [static]

Test if windows 95, et al.

Returns true iff the platform is win95/98/me.

Definition at line 68 of file CArchMiscWindows.cpp.

References init().

Referenced by CArchDaemonWindows::canInstallDaemon(), CArchDaemonWindows::daemonize(), init(), CArchDaemonWindows::installDaemon(), CArchLogWindows::openLog(), and CArchDaemonWindows::uninstallDaemon().

bool CArchMiscWindows::isWindowsModern (  )  [static]

Test if windows 95, et al.

Returns true iff the platform is win98 or win2k or higher (i.e. not windows 95 or windows NT).

Definition at line 89 of file CArchMiscWindows.cpp.

References init().

bool CArchMiscWindows::processDialog ( MSG *  msg  )  [static]

Process dialog message.

Checks if the message is destined for a dialog. If so the message is passed to the dialog and returns true, otherwise returns false.

Definition at line 382 of file CArchMiscWindows.cpp.

Referenced by CMSWindowsScreen::handleSystemEvent().

int CArchMiscWindows::runDaemon ( RunFunc  runFunc  )  [static]

Run the daemon.

Delegates to CArchDaemonWindows.

Definition at line 128 of file CArchMiscWindows.cpp.

void CArchMiscWindows::setIcons ( HICON  largeIcon,
HICON  smallIcon 
) [static]

Set the application icons.

Definition at line 114 of file CArchMiscWindows.cpp.

void CArchMiscWindows::setValueBinary ( HKEY  key,
const TCHAR *  name,
const std::string &  value 
) [static]

Set a BINARY value in the registry.

Sets the name value of key to value.data().

Definition at line 295 of file CArchMiscWindows.cpp.


The documentation for this class was generated from the following files: