3,245
社区成员
发帖
与我相关
我的任务
分享
//假定是在unicode环境下
setlocale(LC_ALL, "chs"); //使用它下面显示中文正常
wchar_t wstr[] = L"中a文BBcc";
ATLTRACE(L"my Char :%s\r\n",wstr);
ATLTRACE("my Char :%S\r\n",wstr); //注意这里在大S
m_ToolTip.UpdateTipText(nItemID, m_hWnd);
CRect rc;
UINT nPos =0, nItemCount = menu.GetMenuItemCount();
// Get Item Position
for (; nPos < nItemCount; nPos++)
{
if (menu.GetMenuItemID(nPos) == nItemID)
{
break;
}
}
int nRes = menu.GetMenuItemRect(NULL, nPos, &rc);
ATLTRACE("GetMenuItemRect() return %d \nMenu item coordinate(right,top):(%d,%d)\n", nRes, rc.right, rc.top);
CRect rcTip;
CToolInfo toolInfo(TTF_TRACK, m_hWnd);
m_ToolTip.GetToolInfo(&toolInfo);
m_ToolTip.GetWindowRect(&rcTip);
rcTip.MoveToXY(rc.right + 5, rc.top);
m_ToolTip.TrackActivate(&toolInfo, TRUE);
m_ToolTip.MoveWindow(&rcTip);
OutputDebugString(toolInfo.lpsztext);
OutputDebugStringW(L"xxxx");