UNICODE fix for Tooltips

svn path=/branches/lean-explorer/; revision=8740
This commit is contained in:
Martin Fuchs
2004-03-14 22:27:44 +00:00
parent aa1994fbc7
commit 54fff5eacf
2 changed files with 27 additions and 1 deletions
@@ -197,6 +197,9 @@ LRESULT CALLBACK Window::WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPAR
case WM_NOTIFY:
return pThis->Notify(wparam, (NMHDR*)lparam);
case WM_NOTIFYFORMAT:
return NFR_CURRENT;
case WM_CREATE:
return pThis->Init((LPCREATESTRUCT)lparam);
@@ -269,6 +272,9 @@ LRESULT CALLBACK SubclassedWindow::SubclassedWndProc(HWND hwnd, UINT nmsg, WPARA
case WM_NOTIFY:
return pThis->Notify(wparam, (NMHDR*)lparam);
case WM_NOTIFYFORMAT:
return NFR_CURRENT;
case WM_CREATE:
return pThis->Init((LPCREATESTRUCT)lparam);
@@ -456,6 +462,10 @@ INT_PTR CALLBACK Window::DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
pThis->Notify(wparam, (NMHDR*)lparam);
return TRUE; // message has been processed
case WM_NOTIFYFORMAT:
SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
return TRUE; // message has been processed
case WM_NCDESTROY:
delete pThis;
return TRUE; // message has been processed
@@ -1134,6 +1144,10 @@ INT_PTR CALLBACK PropSheetPageDlg::DialogProc(HWND hwnd, UINT nmsg, WPARAM wpara
pThis->Notify(wparam, (NMHDR*)lparam);
return TRUE; // message has been processed
case WM_NOTIFYFORMAT:
SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
return TRUE; // message has been processed
case WM_NCDESTROY:
delete pThis;
return TRUE; // message has been processed
@@ -123,6 +123,12 @@ protected:
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
@@ -797,7 +803,13 @@ struct ToolTip : public WindowHandle
};
ti.lpszText = (LPTSTR) txt;
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
}
};