LVColumn question

Normally to get the name of item i do this:
((LVITEMW*)lparam)->pszText

Reference:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb774760(v=vs.85).aspx

But now i want to use LVCOLUMN and if it is possible get like LPTSTR like pszText
and the subitems.

Reference:
https://msdn.microsoft.com/fr-fr/library/windows/desktop/bb774743(v=vs.85).aspx

Some one can provide me a examples with LVCOLUMN to show like LPTSTR like i did with LVITEM or if it is possible how i could get the subitems of this LVCOLUMN..... Thanks in advance..
Last edited on
Yes but i want to get LPTSTR of lvcolumn.
I am trying with this:
LVCOLUMN->pszText

And use a message to show it:
MessageBoxW(NULL, LVCOLUMN->pszText,LVCOLUMN->pszText, MB_OK);
But show me the follow errors:
$
dllmain.cpp: In function 'LRESULT BSSSendMessageW(HWND, UINT, WPARAM, LPARAM)':
dllmain.cpp:20:29: error: expected primary-expression before '->' token
MessageBoxW(NULL, LVCOLUMN->pszText,LVCOLUMN->pszText, MB_OK);
^~
dllmain.cpp:20:47: error: expected primary-expression before '->' token
MessageBoxW(NULL, LVCOLUMN->pszText,LVCOLUMN->pszText, MB_OK);


Normally with LVITEM not take problems but when i try to get my LVCOLUMN and show it like LPTSTR like i do with LVITEM return me errors. Can you explain why these errors? Thanks in advance.
Last edited on
I don't understand. ListView_GetColumn macro gives you LPLVCOLUMN pcol and then you could use.
pcol->pszText;
Ok sorry i didnt check this point... sorry agian. But i have one question if i do this:
1
2
3
4
5
6
7
LRESULT WINAPI BSSSendMessageW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
    if ( msg == LVM_INSERTITEMW || msg == LVM_SETITEMW)
    {
          //ListView_GetColumn(hwnd,iCol,pcol);
    }
}


I get item using this..
((LVITEMW*)lparam)

I can know which column belong to this item¿? Or if not if use VM_INSERTCOLUMNW .. not sure how i can get column information or pszText. Sorry if i didnt explain well..

Maybe will be useful to use ListView_GetColumn but how i can get these values..
in my case i will have LVCOLUMN* the pointer not so it's the same than pcol?
Last edited on
As far as I understand LVM_INSERTITEMW or LVM_SETITEMW deal only with the item, not the column(subitem). For subitems you need LVM_SETITEM message
Topic archived. No new replies allowed.