示例#1
0
        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();
        }
示例#2
0
        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);
        }
示例#3
0
 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));
     }
 }