reactos/subsys/system/explorer/taskbar
diff -u -r1.40 -r1.41
--- traynotify.cpp 14 Mar 2004 21:02:55 -0000 1.40
+++ traynotify.cpp 14 Mar 2004 22:20:07 -0000 1.41
@@ -95,24 +95,20 @@
// store tool tip text
if (pnid->uFlags & NIF_TIP)
- if (pnid->cbSize==NID_SIZE_W6 || pnid->cbSize==NID_SIZE_W5 || pnid->cbSize==NID_SIZE_W3)
- { // UNICODE version of NOTIFYICONDATA structure
+ if (pnid->cbSize==NID_SIZE_W6 || pnid->cbSize==NID_SIZE_W5 || pnid->cbSize==NID_SIZE_W3) {
+ // UNICODE version of NOTIFYICONDATA structure
LPCWSTR txt = (LPCWSTR)pnid->szTip;
-
- // get string length
int max_len = pnid->cbSize==NID_SIZE_W3? 64: 128;
+ // get tooltip string length
int l = 0;
for(; l<max_len; ++l)
if (!txt[l])
break;
_tipText.assign(txt, l);
- } else if (pnid->cbSize==NID_SIZE_A6 || pnid->cbSize==NID_SIZE_A5 || pnid->cbSize==NID_SIZE_A3)
- { // ANSI version of NOTIFYICONDATA structure
+ } else if (pnid->cbSize==NID_SIZE_A6 || pnid->cbSize==NID_SIZE_A5 || pnid->cbSize==NID_SIZE_A3) {
LPCSTR txt = (LPCSTR)pnid->szTip;
-
- // get string length
int max_len = pnid->cbSize==NID_SIZE_A3? 64: 128;
int l = 0;
@@ -378,9 +374,10 @@
// sync tooltip areas to current icon number
if (_sorted_icons.size() != _last_icon_count) {
RECT rect = {2, 3, 2+16, 3+16};
- size_t tt_idx = 0;
+ size_t icon_cnt = _sorted_icons.size();
- for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
+ size_t tt_idx = 0;
+ while(tt_idx < icon_cnt) {
_tooltip.add(_hwnd, tt_idx++, rect);
rect.left += NOTIFYICON_DIST;
reactos/subsys/system/explorer/utility
diff -u -r1.51 -r1.52
--- window.cpp 26 Feb 2004 21:20:50 -0000 1.51
+++ window.cpp 14 Mar 2004 22:20:10 -0000 1.52
@@ -259,6 +259,9 @@
case WM_NOTIFY:
return pThis->Notify(wparam, (NMHDR*)lparam);
+ case WM_NOTIFYFORMAT:
+ return NFR_CURRENT;
+
case WM_CREATE:
return pThis->Init((LPCREATESTRUCT)lparam);
@@ -331,6 +334,9 @@
case WM_NOTIFY:
return pThis->Notify(wparam, (NMHDR*)lparam);
+ case WM_NOTIFYFORMAT:
+ return NFR_CURRENT;
+
case WM_CREATE:
return pThis->Init((LPCREATESTRUCT)lparam);
@@ -677,6 +683,9 @@
pThis->Notify(wparam, (NMHDR*)lparam);
return TRUE; // message has been processed
+ case WM_NOTIFYFORMAT:
+ return NFR_CURRENT;
+
case WM_NCDESTROY:
delete pThis;
return TRUE; // message has been processed
@@ -1355,6 +1364,9 @@
pThis->Notify(wparam, (NMHDR*)lparam);
return TRUE; // message has been processed
+ case WM_NOTIFYFORMAT:
+ return NFR_CURRENT;
+
case WM_NCDESTROY:
delete pThis;
return TRUE; // message has been processed
reactos/subsys/system/explorer/utility
diff -u -r1.47 -r1.48
--- window.h 14 Mar 2004 21:02:55 -0000 1.47
+++ window.h 14 Mar 2004 22:20:10 -0000 1.48
@@ -138,6 +138,12 @@
static WindowSet s_dialogs;
};
+#ifdef UNICODE
+#define NFR_CURRENT NFR_UNICODE
+#else
+#define NFR_CURRENT NFR_ANSI
+#endif
+
#ifdef _MSC_VER
template<typename CLASS> struct GetWindowHelper
@@ -845,27 +851,40 @@
void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
{
TOOLINFO ti = {
- sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND/*|TTF_TRANSPARENT*/, hparent, (UINT)htool,
+ sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND|TTF_TRANSPARENT, hparent, (UINT)htool,
{0,0,0,0}, 0, (LPTSTR)txt, lparam
};
- SendMessage(_hwnd, TTM_ADDTOOL, 0, (LPARAM)&ti);
+#ifdef UNICODE ///@todo Why is it neccesary to try both TTM_ADDTOOLW and TTM_ADDTOOLW ?!
+ if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
+ SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
+#else
+ if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
+ SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
+#endif
}
void add(HWND hparent, UINT id, const RECT& rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
{
TOOLINFO ti = {
- sizeof(TOOLINFO), TTF_SUBCLASS/*|TTF_TRANSPARENT*/, hparent, id,
+ sizeof(TOOLINFO), TTF_SUBCLASS|TTF_TRANSPARENT, hparent, id,
{rect.left,rect.top,rect.right,rect.bottom}, 0, (LPTSTR)txt, lparam
};
- SendMessage(_hwnd, TTM_ADDTOOL, 0, (LPARAM)&ti);
+#ifdef UNICODE
+ if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
+ SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
+#else
+ if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
+ SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
+#endif
}
void remove(HWND hparent, HWND htool)
{
TOOLINFO ti = {
- sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT)htool, {0,0,0,0}, 0, 0, 0
+ sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT)htool,
+ {0,0,0,0}, 0, 0, 0
};
SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
@@ -874,7 +893,8 @@
void remove(HWND hparent, UINT id)
{
TOOLINFO ti = {
- sizeof(TOOLINFO), 0, hparent, id, {0,0,0,0}, 0, 0, 0
+ sizeof(TOOLINFO), 0, hparent, id,
+ {0,0,0,0}, 0, 0, 0
};
SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);