{"id":391,"date":"2008-05-23T17:51:11","date_gmt":"2008-05-23T15:51:11","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=391"},"modified":"2008-08-22T16:51:32","modified_gmt":"2008-08-22T14:51:32","slug":"did-you-know-that-lvn_getinfotip","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/391","title":{"rendered":"Did you know that: LVN_GETINFOTIP?"},"content":{"rendered":"<p>Did you know that when you handle <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/bb774835(VS.85).aspx?wt.slv=TopSectionSee\">LVN_GETINFOTIP<\/a> notification message and you are provided with <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/aa923928.aspx\">NMLVGETINFOTIP<\/a> structure, you cannot just supply your own <strong>pszText<\/strong> string for the tooltip text? Instead you have to copy your string into supplied buffer, such as using <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms860450.aspx?s=6\">_tcsncpy<\/a> function. Otherwise things would not work.<\/p>\n<pre>BEGIN_MSG_MAP_EX(CFooPropertyPage)\r\n\tCHAIN_MSG_MAP(CPropertyPageT<CFooPropertyPage)>)\r\n\t...\r\n\tMSG_LVN_GETINFOTIP(IDC_FOOLISTVIEW, OnFooListViewGetInfoTip) \r\n\tREFLECT_NOTIFICATIONS()\r\nEND_MSG_MAP()\r\n...\r\nLRESULT OnFooListViewGetInfoTip(NMLVGETINFOTIP* pHeader)\r\n{\r\n\tATLASSERT(!pHeader->lParam);\r\n\tCFoo* pFoo = m_FooListView.GetItemData(pHeader->iItem);\r\n\tCString& sTextBuffer = m_ModelListView.GetTextBufferString(TRUE);\r\n\t...\r\n\tsTextBuffer.TrimRight(_T(\"\\t\\n\\r \"));\r\n\t_tcsncpy(pHeader->pszText, sTextBuffer, pHeader->cchTextMax - 1);\r\n\tpHeader->pszText[pHeader->cchTextMax - 1] = 0;\r\n\treturn 0;\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that when you handle LVN_GETINFOTIP notification message and you are provided with NMLVGETINFOTIP structure, you cannot just supply your own pszText string for the tooltip text? Instead you have to copy your string into supplied buffer, such as using _tcsncpy function. Otherwise things would not work. BEGIN_MSG_MAP_EX(CFooPropertyPage) CHAIN_MSG_MAP(CPropertyPageT) &#8230; MSG_LVN_GETINFOTIP(IDC_FOOLISTVIEW, OnFooListViewGetInfoTip) REFLECT_NOTIFICATIONS()&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/391\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,20],"tags":[70],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-technology","category-wtl","tag-winapi"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}