J
J
jspie2018-06-07 21:36:48
C++ / C#
jspie, 2018-06-07 21:36:48

How to put task title in ListView via WinApi?

There is a listView1 component. How can I put the title of the task there? I am trying in this way:

if (Process32First(hSnapshot, &pe)) {
do{
        ListViewItem ^ lviTasks = gcnew ListViewItem(pe.szExeFile);
        lviTasks ->SubItems->Add(pe.cntThreads);
        listView1->Items->Add(lviTasks );
CloseHandle(hProcess);
} while (Process32Next(hSnapshot, &pe));
}

But there is an error:
5b197ac79477e675807666.png
How can I add an item to the listView the name of the tasks?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ApeCoder, 2018-06-07
@jspie

The constructor requires System::String :: and not WCHAR *
gcnew ListViewItem(gcnew String(pe.szExeFile));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question