void pListView::append(const lstring &list) { wchar_t empty[] = L""; unsigned row = ListView_GetItemCount(hwnd); LVITEM item; item.mask = LVIF_TEXT; item.iItem = row; item.iSubItem = 0; item.pszText = empty; locked = true; ListView_InsertItem(hwnd, &item); locked = false; for(unsigned column = 0; column < list.size(); column++) { utf16_t wtext(list(column, "")); ListView_SetItemText(hwnd, row, column, wtext); } }
void Keyb_SendKeys(String text, long finalDelay, long delayBetweenKeys) { Array <wchar> virt; bool inKey = false; String key = ""; WString wtext(text); for (int i = 0; i < wtext.GetCount(); ++i) { bool vk = false; Sleep(delayBetweenKeys); wchar c = wtext[i]; if (c == '{') inKey = true; else if (c == '}') { if (key == "{") c = '{'; else { c = GetKeyCode(key); vk = true; } inKey = false; key = ""; } else if (inKey == 1) key.Cat(c); else if (c == '\n') { c = GetKeyCode("RETURN"); vk = true; } if (inKey == false) { if (!vk) PressKey(c); #if defined(PLATFORM_WIN32) || defined (PLATFORM_WIN64) else { PressKeyVK(c, true); virt.Add(c); } #endif } } #if defined(PLATFORM_WIN32) || defined (PLATFORM_WIN64) for (int i = 0; i < virt.GetCount(); ++i) PressKeyVK(virt[i], false, true); #endif Sleep(finalDelay); }
void pListView::modify(unsigned row, const lstring &list) { for(unsigned n = 0; n < list.size(); n++) { utf16_t wtext(list(n, "")); ListView_SetItemText(hwnd, row, n, wtext); } }
void pListView::setText(unsigned selection, unsigned position, string text) { utf16_t wtext(text); ListView_SetItemText(hwnd, selection, position, wtext); }