ReactOS  0.4.14-dev-50-g13bb5e2
traynotify.cpp File Reference
#include <precomp.h>
#include "traynotify.h"
#include "../notifyhook/notifyhook.h"
Include dependency graph for traynotify.cpp:

Go to the source code of this file.

Macros

#define NID_SIZE_W6   sizeof(NOTIFYICONDATAW)
 
#define NID_SIZE_W5   (sizeof(NOTIFYICONDATAW)-sizeof(GUID))
 
#define NID_SIZE_W3   (sizeof(NOTIFYICONDATAW)-sizeof(GUID)-(128-64)*sizeof(WCHAR))
 
#define NID_SIZE_A6   sizeof(NOTIFYICONDATAA)
 
#define NID_SIZE_A5   (sizeof(NOTIFYICONDATAA)-sizeof(GUID))
 
#define NID_SIZE_A3   (sizeof(NOTIFYICONDATAA)-sizeof(GUID)-(128-64)*sizeof(CHAR))
 

Functions

static bool get_hide_clock_from_registry ()
 
String string_from_mode (NOTIFYICONMODE mode)
 

Macro Definition Documentation

◆ NID_SIZE_A3

#define NID_SIZE_A3   (sizeof(NOTIFYICONDATAA)-sizeof(GUID)-(128-64)*sizeof(CHAR))

Definition at line 102 of file traynotify.cpp.

◆ NID_SIZE_A5

#define NID_SIZE_A5   (sizeof(NOTIFYICONDATAA)-sizeof(GUID))

Definition at line 101 of file traynotify.cpp.

◆ NID_SIZE_A6

#define NID_SIZE_A6   sizeof(NOTIFYICONDATAA)

Definition at line 100 of file traynotify.cpp.

◆ NID_SIZE_W3

#define NID_SIZE_W3   (sizeof(NOTIFYICONDATAW)-sizeof(GUID)-(128-64)*sizeof(WCHAR))

Definition at line 97 of file traynotify.cpp.

◆ NID_SIZE_W5

#define NID_SIZE_W5   (sizeof(NOTIFYICONDATAW)-sizeof(GUID))

Definition at line 96 of file traynotify.cpp.

◆ NID_SIZE_W6

#define NID_SIZE_W6   sizeof(NOTIFYICONDATAW)

Definition at line 95 of file traynotify.cpp.

Function Documentation

◆ get_hide_clock_from_registry()

static bool get_hide_clock_from_registry ( )
static

Definition at line 223 of file traynotify.cpp.

224 {
225  HKEY hkeyStuckRects = 0;
226  DWORD buffer[10];
227  DWORD len = sizeof(buffer);
228 
229  bool hide_clock = false;
230 
231  // check if the clock should be hidden
232  if (!RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRects2"), &hkeyStuckRects) &&
233  !RegQueryValueEx(hkeyStuckRects, TEXT("Settings"), 0, NULL, (LPBYTE)buffer, &len) &&
234  len==sizeof(buffer) && buffer[0]==sizeof(buffer))
235  hide_clock = buffer[2] & 0x08? true: false;
236 
237  if (hkeyStuckRects)
238  RegCloseKey(hkeyStuckRects);
239 
240  return hide_clock;
241 }
#define RegQueryValueEx
Definition: winreg.h:524
#define HKEY_CURRENT_USER
Definition: winreg.h:11
GLuint buffer
Definition: glext.h:5915
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define TEXT(s)
Definition: k32.h:26
#define RegOpenKey
Definition: winreg.h:519

Referenced by NotifyArea::read_config().

◆ string_from_mode()

String string_from_mode ( NOTIFYICONMODE  mode)

Definition at line 863 of file traynotify.cpp.

864 {
865  switch(mode) {
866  case NIM_SHOW:
867  return ResString(IDS_NOTIFY_SHOW);
868 
869  case NIM_HIDE:
870  return ResString(IDS_NOTIFY_HIDE);
871 
872  default: //case NIM_AUTO
874  }
875 }
#define IDS_NOTIFY_SHOW
Definition: resource.h:44
#define IDS_NOTIFY_AUTOHIDE
Definition: resource.h:46
#define IDS_NOTIFY_HIDE
Definition: resource.h:45
GLenum mode
Definition: glext.h:6217
convenient loading of string resources
Definition: globals.h:303

Referenced by TrayNotifyDlg::InsertItem(), and NotifyArea::write_config().