private void bindGrid() { handleList.Items.Clear(); var windowslist = EasyWinApi.GetWindowInfosByKey(searchTxt.Text); foreach (var info in windowslist) { ListViewItem lvi = new ListViewItem(); lvi.Text = info.hWnd.ToString(); lvi.SubItems.Add(info.szWindowName); this.handleList.Items.Add(lvi); } this.handleList.EndUpdate(); }
private void simpleButton3_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(handleLock.Text)) { return; } var handle = EasyWinApi.GetWindowIntPtrByKey(handleLock.Text); EasyWinApi.SetWindowPos(handle); var text = mainText.Text; var metres = makeString(text); // string temp = ""; // foreach (var metre in metres) // { // temp += metre.data; // } doPlay(metres); // MessageBox.Show(temp); }
private void doPlay(List <Metre> metres) { foreach (var metre in metres) { foreach (var c in metre.data) { try { string bytestr = VcCode.vc_code[c.ToString()].ToString(); byte key = Convert.ToByte(bytestr, 16); EasyWinApi.sendKey(key); } catch (Exception e) { MessageBox.Show(e.Message); break; } } Thread.Sleep(Convert.ToInt32(1000 * metre.time)); } }