Extract all items from SysListView32
<p>i tried to extract all items from SysListView32,</p>

<p>this is the code:</p>

<pre><code>#define WIN32_LEAN_AND_MEAN
#include "stdafx.h"
#include &lt;stdio.h&gt;
#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;

int main(void) {

 HWND hwnd=FindWindow(TEXT("Window"), TEXT("Cheat Engine 6.1"));
 HWND win=FindWindowEx(hwnd, NULL, TEXT("Window"), NULL);
 HWND listview=FindWindowEx(win, NULL, TEXT("SysListView32"), NULL);

    int count=(int)SendMessage(listview, LVM_GETITEMCOUNT, 0, 0);
    int i;

    LVITEM lvi, *_lvi;
    char item[512], subitem[512];
    char *_item, *_subitem;
    unsigned long pid;
    HANDLE process;

    GetWindowThreadProcessId(listview, &amp;pid);
    process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid);

    _lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE);
    _item=(char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT, PAGE_READWRITE);
    _subitem=(char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT, PAGE_READWRITE);

    lvi.cchTextMax=512;

    for(i=0; i&lt;count; i++) {
        lvi.iSubItem=0;
        lvi.pszText=_item;
        WriteProcessMemory(process, _lvi, &amp;lvi, sizeof(LVITEM), NULL);
        SendMessage(listview, LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)_lvi);

        lvi.iSubItem=1;
        lvi.pszText=_subitem;
        WriteProcessMemory(process, _lvi, &amp;lvi, sizeof(LVITEM), NULL);
        SendMessage(listview, LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)_lvi);

        ReadProcessMemory(process, _item, item, 512, NULL);
        ReadProcessMemory(process, _subitem, subitem, 512, NULL);

        printf("%s - %s\n", item, subitem);
    }

    VirtualFreeEx(process, _lvi, 0, MEM_RELEASE);
    VirtualFreeEx(process, _item, 0, MEM_RELEASE);
    VirtualFreeEx(process, _subitem, 0, MEM_RELEASE);

    return 0;
}
</code></pre>

<p>Error:</p>

<p><code>cannot convert from 'char *' to 'LPWSTR'</code> at line: <code>lvi.pszText=_item;</code></p>

<p>Error 2:</p>

<p><code>IntelliSense: a value of type "char *" cannot be assigned to an entity of type "LPWSTR"</code> at line: <code>lvi.pszText=_subitem;</code></p>

<p>i tried <code>TEXT(_subitem)</code> , Still not working.</p>
