Esempio n. 1
0
        //写入文本文件
        public static void InputText()
        {
            //句柄是用精易助手获取的
            //WinApi.leftClick(7669360);
            //Thread.Sleep(100);
            //keybd_event(Keys.A, 0, 0, 0);
            //keybd_event(Keys.A, 0, 2, 0);
            //Thread.Sleep(100);
            //keybd_event(Keys.A, 0, 0, 0);
            //keybd_event(Keys.A, 0, 2, 0);

            WinApi.SendMessage((IntPtr)7669360, 0x0C, IntPtr.Zero, "1234567890");
        }
Esempio n. 2
0
        /// <summary>
        /// 操作下拉框--成功
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button11_Click(object sender, EventArgs e)
        {
            string selectStr = "";
            IntPtr bar       = (IntPtr)132678;

            //var control = Control.FromHandle((IntPtr)198216);


            //通过索引设置下拉框选项
            int selected = WinApi.SendMessage(bar, 0x014e, (IntPtr)9, "");

            //通过索引获取下拉框选项
            Thread.Sleep(1000);
            string selectedStr = GetText(bar);

            //获得选项数量
            int count = SendMessage(bar, 0x0146, 0, 0);
        }
Esempio n. 3
0
 /// <summary>
 /// 发送字符串(操作文本文件)
 /// </summary>
 /// <param name="hWnd"></param>
 private void sendMessage(IntPtr hWnd)
 {
     WinApi.SendMessage(hWnd, 0x0C, IntPtr.Zero, "测试发送数据");
 }
Esempio n. 4
0
 public static void SelectTest()
 {
     WinApi.SendMessage((IntPtr)395158, 0x0C, IntPtr.Zero, "kkk");
 }