ReactOS  0.4.12-dev-75-g00dd17e
TrayNotifyDlg Struct Reference

configuration dialog for notification icons More...

#include <traynotify.h>

Inheritance diagram for TrayNotifyDlg:
Collaboration diagram for TrayNotifyDlg:

Public Types

typedef ResizeController< Dialogsuper
 
- Public Types inherited from ResizeController< Dialog >
typedef Dialog super
 
- Public Types inherited from Dialog
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 TrayNotifyDlg (HWND hwnd)
 
 ~TrayNotifyDlg ()
 
- Public Member Functions inherited from ResizeController< Dialog >
 ResizeController (HWND hwnd)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual void GetClientSpace (PRECT prect)
 
- Public Member Functions inherited from Dialog
 Dialog (HWND)
 
 ~Dialog ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 

Protected Types

typedef pair< NOTIFYICONMODE, DWORDIconStatePair
 
typedef map< NotifyIconIndex, IconStatePairIconStateMap
 

Protected Member Functions

virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void Refresh ()
 
void InsertItem (HTREEITEM hparent, HTREEITEM after, const NotifyInfo &, HDC)
 
void InsertItem (HTREEITEM hparent, HTREEITEM after, const NotifyIconDlgInfo &, HDC, HICON, NOTIFYICONMODE)
 
void SetIconMode (NOTIFYICONMODE mode)
 
void RefreshProperties (const NotifyIconDlgInfo &entry)
 
- Protected Member Functions inherited from Dialog
int Command (int id, int code)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 

Protected Attributes

HWND _tree_ctrl
 
HACCEL _haccel
 
HIMAGELIST _himl
 
NotifyArea_pNotifyArea
 
NotifyIconDlgInfoMap _info
 
NotifyIconCfgList _cfg_org
 
IconStateMap _icon_states_org
 
bool _show_hidden_org
 
HTREEITEM _hitemCurrent
 
HTREEITEM _hitemCurrent_visible
 
HTREEITEM _hitemCurrent_hidden
 
HTREEITEM _hitemConfig
 
HTREEITEM _selectedItem
 
- Protected Attributes inherited from ResizeController< Dialog >
ResizeManager _resize_mgr
 

Additional Inherited Members

- Static Public Member Functions inherited from Dialog
static int DoModal (UINT nid, CREATORFUNC creator, HWND hwndParent=0)
 
static int DoModal (UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0)
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

configuration dialog for notification icons

Definition at line 198 of file traynotify.h.

Member Typedef Documentation

◆ IconStateMap

Definition at line 213 of file traynotify.h.

◆ IconStatePair

Definition at line 212 of file traynotify.h.

◆ super

Definition at line 200 of file traynotify.h.

Constructor & Destructor Documentation

◆ TrayNotifyDlg()

TrayNotifyDlg::TrayNotifyDlg ( HWND  hwnd)

Definition at line 878 of file traynotify.cpp.

879  : super(hwnd),
883 {
884  _selectedItem = 0;
885 
886  if (_pNotifyArea) {
887  // save original icon states and configuration data
889  _icon_states_org[it->first] = IconStatePair(it->second._mode, it->second._dwState);
890 
893  }
894 
895  SetWindowIcon(hwnd, IDI_REACTOS);
896 
898 
899  {
900  WindowCanvas canvas(_hwnd);
901  HBRUSH hbkgnd = GetStockBrush(WHITE_BRUSH);
902 
903  ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT), hbkgnd, canvas);
906  }
907 
909 
917 
922 
925 
928 
931 
932  _resize_mgr.Resize(+150, +200);
933 
934  Refresh();
935 
936  SetTimer(_hwnd, 0, 3000, NULL);
937  register_pretranslate(hwnd);
938 }
#define IDC_LABEL1
Definition: resource.h:155
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDA_TRAYNOTIFY
Definition: resource.h:79
#define IDC_NOTIFY_AUTOHIDE
Definition: resource.h:170
#define IDOK
Definition: winuser.h:824
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
Definition: explorer.cpp:366
#define ID_SHOW_HIDDEN_ICONS
Definition: resource.h:217
HIMAGELIST _himl
Definition: traynotify.h:208
static void register_pretranslate(HWND hwnd)
Definition: window.cpp:579
HACCEL _haccel
Definition: traynotify.h:207
#define SM_CYSMICON
Definition: winuser.h:1003
#define WHITE_BRUSH
Definition: wingdi.h:900
NotifyIconMap _icon_map
Definition: traynotify.h:174
#define IDC_NOTIFY_SHOW
Definition: resource.h:168
void Add(UINT id, int flags)
Definition: window.h:491
NotifyIconCfgList _cfg
Definition: traynotify.h:170
_Rep_type::const_iterator const_iterator
Definition: _map.h:86
bool _show_hidden
Definition: traynotify.h:148
#define LoadAccelerators
Definition: winuser.h:5676
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:769
#define IDC_LABEL2
Definition: resource.h:157
smooth NULL
Definition: ftsmooth.c:416
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3414
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define PM_GET_NOTIFYAREA
Definition: traynotify.h:44
pair< NOTIFYICONMODE, DWORD > IconStatePair
Definition: traynotify.h:212
convenient loading of small (16x16) icon resources
Definition: globals.h:320
Definition: window.h:466
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define GetStockBrush(i)
Definition: windowsx.h:282
Definition: window.h:462
#define ILC_COLOR24
Definition: commctrl.h:342
#define IDC_NOTIFY_MODULE
Definition: resource.h:153
HWND _hwndDesktopBar
Definition: globals.h:287
int WINAPI GetSystemMetrics(_In_ int)
HTREEITEM _selectedItem
Definition: traynotify.h:223
#define IDC_LAST_CHANGE
Definition: resource.h:164
#define IDC_LABEL3
Definition: resource.h:159
#define SM_CXSMICON
Definition: winuser.h:1002
HINSTANCE _hInstance
Definition: globals.h:270
#define IDI_REACTOS
Definition: osk_res.h:22
#define IDC_LABEL6
Definition: resource.h:162
Definition: window.h:467
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
NotifyArea * _pNotifyArea
Definition: traynotify.h:209
#define IDC_NOTIFY_HIDE
Definition: resource.h:169
#define IDC_LABEL4
Definition: resource.h:171
#define IDI_DOT_RED
Definition: resource.h:117
ResizeController< Dialog > super
Definition: traynotify.h:200
IconStateMap _icon_states_org
Definition: traynotify.h:216
void SetWindowIcon(HWND hwnd, UINT nid)
set big and small icons out of the resources for a window
Definition: explorer.cpp:689
ResizeManager _resize_mgr
Definition: window.h:563
#define IDI_DOT_TRANS
Definition: resource.h:116
bool _show_hidden_org
Definition: traynotify.h:217
#define IDC_NOTIFY_TOOLTIP
Definition: resource.h:149
#define TVSIL_NORMAL
Definition: commctrl.h:3410
#define SendMessage
Definition: winuser.h:5709
#define IDCANCEL
Definition: winuser.h:825
iterator begin()
Definition: _map.h:163
#define IDI_DOT
Definition: resource.h:114
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203
#define IDC_NOTIFY_ICONS
Definition: resource.h:145
#define IDC_NOTIFY_TITLE
Definition: resource.h:151
NotifyIconCfgList _cfg_org
Definition: traynotify.h:215
void Resize(int dx, int dy)
Definition: window.cpp:847
#define IDC_PICTURE
Definition: resource.h:167
iterator end()
Definition: _map.h:165

◆ ~TrayNotifyDlg()

TrayNotifyDlg::~TrayNotifyDlg ( )

Definition at line 940 of file traynotify.cpp.

941 {
942  KillTimer(_hwnd, 0);
945 }
HIMAGELIST _himl
Definition: traynotify.h:208
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:893
static void unregister_pretranslate(HWND hwnd)
Definition: window.cpp:584
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Member Function Documentation

◆ Command()

int TrayNotifyDlg::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from Window.

Definition at line 1092 of file traynotify.cpp.

1093 {
1094  if (code == BN_CLICKED) {
1095  switch(id) {
1096  case ID_REFRESH:
1097  Refresh();
1098  break;
1099 
1100  case IDC_NOTIFY_SHOW:
1102  break;
1103 
1104  case IDC_NOTIFY_HIDE:
1106  break;
1107 
1108  case IDC_NOTIFY_AUTOHIDE:
1110  break;
1111 
1112  case ID_SHOW_HIDDEN_ICONS:
1113  if (_pNotifyArea)
1115  break;
1116 
1117  case IDOK:
1118  EndDialog(_hwnd, id);
1119  break;
1120 
1121  case IDCANCEL:
1122  // rollback changes
1123  if (_pNotifyArea) {
1124  // restore original icon states and configuration data
1127 
1129  NotifyInfo& info = _pNotifyArea->_icon_map[it->first];
1130 
1131  info._mode = it->second.first;
1132  info._dwState = it->second.second;
1133  }
1134 
1136  }
1137 
1138  EndDialog(_hwnd, id);
1139  break;
1140  }
1141 
1142  return 0;
1143  }
1144 
1145  return 1;
1146 }
DWORD _dwState
Definition: traynotify.h:105
#define IDC_NOTIFY_AUTOHIDE
Definition: resource.h:170
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define IDOK
Definition: winuser.h:824
#define ID_REFRESH
Definition: resource.h:18
NOTIFYICONMODE _mode
Definition: traynotify.h:83
#define ID_SHOW_HIDDEN_ICONS
Definition: resource.h:217
NotifyIconMap _icon_map
Definition: traynotify.h:174
#define IDC_NOTIFY_SHOW
Definition: resource.h:168
NotifyIconCfgList _cfg
Definition: traynotify.h:170
_Rep_type::const_iterator const_iterator
Definition: _map.h:86
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
bool _show_hidden
Definition: traynotify.h:148
void SetIconMode(NOTIFYICONMODE mode)
#define BN_CLICKED
Definition: winuser.h:1886
structure for maintaining informations about one notification icon
Definition: traynotify.h:93
NotifyArea * _pNotifyArea
Definition: traynotify.h:209
#define IDC_NOTIFY_HIDE
Definition: resource.h:169
#define WM_COMMAND
Definition: winuser.h:1716
IconStateMap _icon_states_org
Definition: traynotify.h:216
#define PM_REFRESH
Definition: explorer.h:69
bool _show_hidden_org
Definition: traynotify.h:217
#define SendMessage
Definition: winuser.h:5709
#define IDCANCEL
Definition: winuser.h:825
iterator begin()
Definition: _map.h:163
NotifyIconCfgList _cfg_org
Definition: traynotify.h:215
iterator end()
Definition: _map.h:165

◆ InsertItem() [1/2]

void TrayNotifyDlg::InsertItem ( HTREEITEM  hparent,
HTREEITEM  after,
const NotifyInfo entry,
HDC  hdc 
)
protected

Definition at line 1035 of file traynotify.cpp.

Referenced by Refresh().

1036 {
1037  InsertItem(hparent, after, entry, hdc, entry._hIcon, entry._mode);
1038 }
HICON _hIcon
Definition: traynotify.h:104
NOTIFYICONMODE _mode
Definition: traynotify.h:83
void InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyInfo &, HDC)
HDC hdc
Definition: msvc.h:53

◆ InsertItem() [2/2]

void TrayNotifyDlg::InsertItem ( HTREEITEM  hparent,
HTREEITEM  after,
const NotifyIconDlgInfo entry,
HDC  hdc,
HICON  hicon,
NOTIFYICONMODE  mode 
)
protected

Definition at line 1040 of file traynotify.cpp.

1042 {
1043  int idx = _info.size() + 1;
1044  _info[idx] = entry;
1045 
1046  String mode_str = string_from_mode(mode);
1047 
1048  switch(mode) {
1049  case NIM_SHOW: mode_str = ResString(IDS_NOTIFY_SHOW); break;
1050  case NIM_HIDE: mode_str = ResString(IDS_NOTIFY_HIDE); break;
1051  case NIM_AUTO: mode_str = ResString(IDS_NOTIFY_AUTOHIDE);
1052  }
1053 
1054  FmtString txt(TEXT("%s - %s [%s]"), entry._tipText.c_str(), entry._windowTitle.c_str(), mode_str.c_str());
1055 
1056  TV_INSERTSTRUCT tvi;
1057 
1058  tvi.hParent = hparent;
1059  tvi.hInsertAfter = after;
1060 
1061  TV_ITEM& tv = tvi.item;
1063 
1064  tv.lParam = (LPARAM)idx;
1065  tv.pszText = txt.str();
1066  tv.iSelectedImage = tv.iImage = ImageList_AddAlphaIcon(_himl, hicon, GetStockBrush(WHITE_BRUSH), hdc);
1068 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
Definition: explorer.cpp:366
uint8_t entry
Definition: isohybrid.c:63
HIMAGELIST _himl
Definition: traynotify.h:208
#define IDS_NOTIFY_SHOW
Definition: resource.h:44
#define WHITE_BRUSH
Definition: wingdi.h:900
static WCHAR String[]
Definition: stringtable.c:55
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3238
String string_from_mode(NOTIFYICONMODE mode)
Definition: traynotify.cpp:863
NotifyIconDlgInfoMap _info
Definition: traynotify.h:210
size_type size() const
Definition: _map.h:172
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3379
unsigned int idx
Definition: utils.c:41
HDC hdc
Definition: msvc.h:53
#define IDS_NOTIFY_AUTOHIDE
Definition: resource.h:46
#define GetStockBrush(i)
Definition: windowsx.h:282
#define IDS_NOTIFY_HIDE
Definition: resource.h:45
String _windowTitle
Definition: traynotify.h:80
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2419
#define TV_ITEM
Definition: commctrl.h:3267
#define TEXT(s)
Definition: k32.h:26
#define TVIF_TEXT
Definition: commctrl.h:3233
#define TVIF_IMAGE
Definition: commctrl.h:3234
#define TVIF_PARAM
Definition: commctrl.h:3235
convenient loading of string resources
Definition: globals.h:303
#define TV_INSERTSTRUCT
Definition: commctrl.h:3344
#define LPARAM
Definition: msvc.h:38

◆ Notify()

int TrayNotifyDlg::Notify ( int  id,
NMHDR pnmh 
)
protectedvirtual

Reimplemented from Window.

Definition at line 1148 of file traynotify.cpp.

1149 {
1150  switch(pnmh->code) {
1151  case TVN_SELCHANGED: {
1152  NMTREEVIEW* pnmtv = (NMTREEVIEW*)pnmh;
1153  int idx = pnmtv->itemNew.lParam;
1154 
1155  if (idx) {
1156  RefreshProperties(_info[idx]);
1157  _selectedItem = pnmtv->itemNew.hItem;
1158  } else {
1159  /*
1160  SetDlgItemText(_hwnd, IDC_NOTIFY_TOOLTIP, NULL);
1161  SetDlgItemText(_hwnd, IDC_NOTIFY_TITLE, NULL);
1162  SetDlgItemText(_hwnd, IDC_NOTIFY_MODULE, NULL);
1163  */
1165  }
1166  break;}
1167  }
1168 
1169  return 0;
1170 }
#define IDC_NOTIFY_AUTOHIDE
Definition: resource.h:170
#define IDC_NOTIFY_SHOW
Definition: resource.h:168
NotifyIconDlgInfoMap _info
Definition: traynotify.h:210
UINT code
Definition: winuser.h:3112
#define NMTREEVIEW
Definition: commctrl.h:3609
unsigned int idx
Definition: utils.c:41
#define TVN_SELCHANGED
Definition: commctrl.h:3702
HTREEITEM _selectedItem
Definition: traynotify.h:223
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
void RefreshProperties(const NotifyIconDlgInfo &entry)

◆ Refresh()

void TrayNotifyDlg::Refresh ( )
protected
Todo:
refresh incrementally

Definition at line 947 of file traynotify.cpp.

Referenced by Command(), SetIconMode(), TrayNotifyDlg(), and WndProc().

948 {
950 
951  HiddenWindow hide(_tree_ctrl);
952 
954 
955  TV_INSERTSTRUCT tvi;
956 
957  tvi.hParent = 0;
958  tvi.hInsertAfter = TVI_LAST;
959 
960  TV_ITEM& tv = tvi.item;
962 
963  ResString str_cur(IDS_ITEMS_CUR);
964  tv.pszText = str_cur.str();
965  tv.iSelectedImage = tv.iImage = 0; // IDI_DOT
967 
969  tv.pszText = str_conf.str();
970  tv.iSelectedImage = tv.iImage = 2; // IDI_DOT_RED
972 
973  tvi.hParent = _hitemCurrent;
974 
975  ResString str_visible(IDS_ITEMS_VISIBLE);
976  tv.pszText = str_visible.str();
977  tv.iSelectedImage = tv.iImage = 0; // IDI_DOT
979 
980  ResString str_hidden(IDS_ITEMS_HIDDEN);
981  tv.pszText = str_hidden.str();
982  tv.iSelectedImage = tv.iImage = 1; // IDI_DOT_TRANS
984 
985  if (_pNotifyArea) {
986  _info.clear();
987 
988  tv.mask |= TVIF_PARAM;
989 
990  WindowCanvas canvas(_hwnd);
991 
992  // insert current (visible and hidden) items
994  const NotifyInfo& entry = it->second;
995 
996  InsertItem(entry._dwState&NIS_HIDDEN? _hitemCurrent_hidden: _hitemCurrent_visible, TVI_LAST, entry, canvas);
997  }
998 
999  // insert configured items in tree view
1000  const NotifyIconCfgList& cfg = _pNotifyArea->_cfg;
1001  for(NotifyIconCfgList::const_iterator it=cfg.begin(); it!=cfg.end(); ++it) {
1002  const NotifyIconConfig& cfg_entry = *it;
1003 
1004  HICON hicon = 0;
1005 
1006  if (!cfg_entry._modulePath.empty()) {
1007  if ((int)ExtractIconEx(cfg_entry._modulePath, 0, NULL, &hicon, 1) <= 0)
1008  hicon = 0;
1009 
1010  if (!hicon) {
1011  SHFILEINFO sfi;
1012 
1013  if (SHGetFileInfo(cfg_entry._modulePath, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON))
1014  hicon = sfi.hIcon;
1015  }
1016  }
1017 
1018  InsertItem(_hitemConfig, TVI_SORT, cfg_entry, canvas, hicon, cfg_entry._mode);
1019 
1020  if (hicon)
1021  DestroyIcon(hicon);
1022  }
1023 
1025  }
1026 
1031 
1033 }
DWORD _dwState
Definition: traynotify.h:105
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
iterator begin()
Definition: _list.h:367
static HICON
Definition: imagelist.c:84
HTREEITEM _hitemCurrent_visible
Definition: traynotify.h:220
NOTIFYICONMODE _mode
Definition: traynotify.h:83
#define ID_SHOW_HIDDEN_ICONS
Definition: resource.h:217
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3384
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
uint8_t entry
Definition: isohybrid.c:63
#define TVI_SORT
Definition: commctrl.h:3338
#define IDS_ITEMS_VISIBLE
Definition: resource.h:42
NotifyIconMap _icon_map
Definition: traynotify.h:174
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3238
NotifyIconDlgInfoMap _info
Definition: traynotify.h:210
#define SHGFI_SMALLICON
Definition: shellapi.h:173
NotifyIconCfgList _cfg
Definition: traynotify.h:170
_Rep_type::const_iterator const_iterator
Definition: _map.h:86
bool _show_hidden
Definition: traynotify.h:148
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3379
HTREEITEM _hitemCurrent
Definition: traynotify.h:219
void InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyInfo &, HDC)
#define IDS_ITEMS_CONFIGURED
Definition: resource.h:41
configuration for the display mode of a notification icon
Definition: traynotify.h:71
#define IDS_ITEMS_HIDDEN
Definition: resource.h:43
smooth NULL
Definition: ftsmooth.c:416
#define TVI_LAST
Definition: commctrl.h:3337
_STLP_PRIV _List_iterator< NotifyIconConfig, _Const_traits< NotifyIconConfig > > const_iterator
Definition: _list.h:276
HTREEITEM _hitemCurrent_hidden
Definition: traynotify.h:221
#define IDS_ITEMS_CUR
Definition: resource.h:40
structure for maintaining informations about one notification icon
Definition: traynotify.h:93
#define TVE_EXPAND
Definition: commctrl.h:3390
void clear()
Definition: _map.h:206
NotifyArea * _pNotifyArea
Definition: traynotify.h:209
#define BST_UNCHECKED
Definition: winuser.h:199
#define TV_ITEM
Definition: commctrl.h:3267
#define TreeView_EnsureVisible(hwnd, hitem)
Definition: commctrl.h:3512
#define TVIF_TEXT
Definition: commctrl.h:3233
iterator end()
Definition: _list.h:370
#define TVIF_IMAGE
Definition: commctrl.h:3234
#define BST_CHECKED
Definition: winuser.h:197
String _modulePath
Definition: traynotify.h:81
#define SHGetFileInfo
Definition: shellapi.h:683
HICON hIcon
Definition: shellapi.h:361
#define TVIF_PARAM
Definition: commctrl.h:3235
HTREEITEM _hitemConfig
Definition: traynotify.h:222
convenient loading of string resources
Definition: globals.h:303
iterator begin()
Definition: _map.h:163
#define SHGFI_ICON
Definition: shellapi.h:162
#define TV_INSERTSTRUCT
Definition: commctrl.h:3344
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3387
#define ExtractIconEx
Definition: shellapi.h:675
iterator end()
Definition: _map.h:165

◆ RefreshProperties()

void TrayNotifyDlg::RefreshProperties ( const NotifyIconDlgInfo entry)
protected

Definition at line 1172 of file traynotify.cpp.

Referenced by Notify().

1173 {
1177 
1179 
1180  String change_str;
1181  if (entry._lastChange)
1182  change_str.printf(TEXT("before %d s"), (GetTickCount()-entry._lastChange+500)/1000);
1183  SetDlgItemText(_hwnd, IDC_LAST_CHANGE, change_str);
1184 
1185  HICON hicon = 0; //get_window_icon_big(entry._hWnd, false);
1186 
1187  // If we could not find an icon associated with the owner window, try to load one from the owning module.
1188  if (!hicon && !entry._modulePath.empty()) {
1189  hicon = ExtractIcon(g_Globals._hInstance, entry._modulePath, 0);
1190 
1191  if (!hicon) {
1192  SHFILEINFO sfi;
1193 
1194  if (SHGetFileInfo(entry._modulePath, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_LARGEICON))
1195  hicon = sfi.hIcon;
1196  }
1197  }
1198 
1199  if (hicon) {
1200  SendMessage(GetDlgItem(_hwnd, IDC_PICTURE), STM_SETICON, (LPARAM)hicon, 0);
1201  DestroyIcon(hicon);
1202  } else
1204 }
#define STM_SETICON
Definition: winuser.h:2053
static HICON
Definition: imagelist.c:84
#define IDC_NOTIFY_AUTOHIDE
Definition: resource.h:170
NOTIFYICONMODE _mode
Definition: traynotify.h:83
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
#define IDC_NOTIFY_SHOW
Definition: resource.h:168
static WCHAR String[]
Definition: stringtable.c:55
LONG_PTR LPARAM
Definition: windef.h:208
#define ExtractIcon
Definition: shellapi.h:674
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_NOTIFY_MODULE
Definition: resource.h:153
String _windowTitle
Definition: traynotify.h:80
#define IDC_LAST_CHANGE
Definition: resource.h:164
#define SetDlgItemText
Definition: winuser.h:5715
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define TEXT(s)
Definition: k32.h:26
#define IDC_NOTIFY_TOOLTIP
Definition: resource.h:149
String _modulePath
Definition: traynotify.h:81
#define SendMessage
Definition: winuser.h:5709
#define SHGetFileInfo
Definition: shellapi.h:683
HICON hIcon
Definition: shellapi.h:361
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define SHGFI_ICON
Definition: shellapi.h:162
#define SHGFI_LARGEICON
Definition: shellapi.h:172
#define IDC_NOTIFY_TITLE
Definition: resource.h:151
#define IDC_PICTURE
Definition: resource.h:167

◆ SetIconMode()

void TrayNotifyDlg::SetIconMode ( NOTIFYICONMODE  mode)
protected
Todo:
select treeview item at new position in tree view -> refresh HTREEITEM in _selectedItem

Definition at line 1206 of file traynotify.cpp.

Referenced by Command().

1207 {
1209 
1210  if (!idx)
1211  return;
1212 
1214 
1215  if (entry._mode != mode) {
1216  entry._mode = mode;
1217 
1218  // trigger refresh in notify area and this dialog
1219  if (_pNotifyArea)
1221  }
1222 
1223  if (_pNotifyArea) {
1224  bool found = false;
1225 
1227  for(NotifyIconCfgList::iterator it=cfg.begin(); it!=cfg.end(); ++it) {
1228  NotifyIconConfig& cfg_entry = *it;
1229 
1230  if (cfg_entry.match(entry)) {
1231  cfg_entry._mode = mode;
1232  ++found;
1233  break;
1234  }
1235  }
1236 
1237  if (!found) {
1238  // insert new configuration entry
1239  NotifyIconConfig cfg_entry = entry;
1240 
1241  cfg_entry._mode = mode;
1242 
1243  _pNotifyArea->_cfg.push_back(cfg_entry);
1244  }
1245  }
1246 
1247  Refresh();
1249 }
void push_back(const_reference __x)
Definition: _list.h:509
iterator begin()
Definition: _list.h:367
bool match(const NotifyIconConfig &props) const
Definition: traynotify.cpp:820
NOTIFYICONMODE _mode
Definition: traynotify.h:83
uint8_t entry
Definition: isohybrid.c:63
NotifyIconDlgInfoMap _info
Definition: traynotify.h:210
NotifyIconCfgList _cfg
Definition: traynotify.h:170
unsigned int idx
Definition: utils.c:41
configuration for the display mode of a notification icon
Definition: traynotify.h:71
HTREEITEM _selectedItem
Definition: traynotify.h:223
_STLP_PRIV _List_iterator< NotifyIconConfig, _Nonconst_traits< NotifyIconConfig > > iterator
Definition: _list.h:275
NotifyArea * _pNotifyArea
Definition: traynotify.h:209
GLenum mode
Definition: glext.h:6217
iterator end()
Definition: _list.h:370
#define PM_REFRESH
Definition: explorer.h:69
#define SendMessage
Definition: winuser.h:5709
LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
Definition: window.h:968

◆ WndProc()

LRESULT TrayNotifyDlg::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented from Window.

Definition at line 1070 of file traynotify.cpp.

1071 {
1072  switch(nmsg) {
1073  case PM_TRANSLATE_MSG: {
1074  MSG* pmsg = (MSG*) lparam;
1075 
1076  if (TranslateAccelerator(_hwnd, _haccel, pmsg))
1077  return TRUE;
1078 
1079  return FALSE;}
1080 
1081  case WM_TIMER:
1082  Refresh();
1083  break;
1084 
1085  default:
1086  return super::WndProc(nmsg, wparam, lparam);
1087  }
1088 
1089  return 0;
1090 }
#define TranslateAccelerator
Definition: winuser.h:5726
#define TRUE
Definition: types.h:120
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
HACCEL _haccel
Definition: traynotify.h:207
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define WM_TIMER
Definition: winuser.h:1718
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:525
UINT WPARAM wparam
Definition: msvc.h:92

Member Data Documentation

◆ _cfg_org

NotifyIconCfgList TrayNotifyDlg::_cfg_org
protected

Definition at line 215 of file traynotify.h.

Referenced by Command(), and TrayNotifyDlg().

◆ _haccel

HACCEL TrayNotifyDlg::_haccel
protected

Definition at line 207 of file traynotify.h.

Referenced by TrayNotifyDlg(), and WndProc().

◆ _himl

HIMAGELIST TrayNotifyDlg::_himl
protected

Definition at line 208 of file traynotify.h.

Referenced by InsertItem(), TrayNotifyDlg(), and ~TrayNotifyDlg().

◆ _hitemConfig

HTREEITEM TrayNotifyDlg::_hitemConfig
protected

Definition at line 222 of file traynotify.h.

Referenced by Refresh().

◆ _hitemCurrent

HTREEITEM TrayNotifyDlg::_hitemCurrent
protected

Definition at line 219 of file traynotify.h.

Referenced by Refresh().

◆ _hitemCurrent_hidden

HTREEITEM TrayNotifyDlg::_hitemCurrent_hidden
protected

Definition at line 221 of file traynotify.h.

Referenced by Refresh().

◆ _hitemCurrent_visible

HTREEITEM TrayNotifyDlg::_hitemCurrent_visible
protected

Definition at line 220 of file traynotify.h.

Referenced by Refresh().

◆ _icon_states_org

IconStateMap TrayNotifyDlg::_icon_states_org
protected

Definition at line 216 of file traynotify.h.

Referenced by Command(), and TrayNotifyDlg().

◆ _info

NotifyIconDlgInfoMap TrayNotifyDlg::_info
protected

Definition at line 210 of file traynotify.h.

Referenced by InsertItem(), Notify(), Refresh(), and SetIconMode().

◆ _pNotifyArea

NotifyArea* TrayNotifyDlg::_pNotifyArea
protected

Definition at line 209 of file traynotify.h.

Referenced by Command(), Refresh(), SetIconMode(), and TrayNotifyDlg().

◆ _selectedItem

HTREEITEM TrayNotifyDlg::_selectedItem
protected

Definition at line 223 of file traynotify.h.

Referenced by Notify(), SetIconMode(), and TrayNotifyDlg().

◆ _show_hidden_org

bool TrayNotifyDlg::_show_hidden_org
protected

Definition at line 217 of file traynotify.h.

Referenced by Command(), and TrayNotifyDlg().

◆ _tree_ctrl

HWND TrayNotifyDlg::_tree_ctrl
protected

Definition at line 206 of file traynotify.h.

Referenced by InsertItem(), Refresh(), SetIconMode(), and TrayNotifyDlg().


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