43template<
typename TYP = CDialog>
76 m_strMap[P->GetDlgCtrlID()] = lpsz;
86 CWnd* P = GetDlgItem(ctrlId);
92 m_strMap[ctrlId] = lpsz;
104 m_toolTip.RelayEvent(pMsg);
105 return _super::PreTranslateMessage(pMsg);
116 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
122 m_toolTip.Activate(TRUE);
126 m_toolTip.DestroyWindow();
129 if ( m_pActiveWnd != NULL )
131 INT_PTR i = m_TestNowPosItem(m_pActiveWnd);
134 i = m_pActiveWnd->GetDlgCtrlID();
136 if ( i != m_activeId )
144 NMHDR* pNMHDR =
reinterpret_cast<NMHDR*
>(lParam);
145 if ( pNMHDR->code == TTN_POP )
150 else if ( pNMHDR->code == TTN_NEEDTEXT )
152 UINT_PTR
id = pNMHDR->idFrom;
153 TOOLTIPTEXT* P =
reinterpret_cast<TOOLTIPTEXT *
>(pNMHDR);
154 if ( (P->uFlags & TTF_IDISHWND) != 0 )
156 CWnd* pWnd = CWnd::FromHandle(
reinterpret_cast<HWND
>(
id));
157 INT_PTR i = m_TestNowPosItem(pWnd);
160 id = pWnd->GetDlgCtrlID();
172 P->lpszText = m_workStr;
177 P->lpszText = MAKEINTRESOURCE(
id);
178 P->hinst = AfxGetResourceHandle();
192 return _super::WindowProc(message, wParam, lParam);
196 CToolTipCtrl m_toolTip;
202 void m_TipCreate(
void)
204 if ( ! ::IsWindow(m_toolTip) )
206 m_toolTip.Create(
this, TTS_ALWAYSTIP);
210 INT_PTR m_TestNowPosItem(
CWnd* pWnd)
212 TOOLINFO ti = {
sizeof(TOOLINFO) };
215 pWnd->ScreenToClient(&po);
216 return pWnd->OnToolHitTest(po, &ti);
221 if ( m_strMap.
HasKey(
id) )
bool HasKey(INK key) const
[確認] キー有無
bool IsEmpty(void) const
[確認] 空チェック