コード例 #1
0
ファイル: RobotCMB.cs プロジェクト: lhunnelSpiral/MyProject
 private void EnterLoginBox(IntPtr mainWindow, IntPtr textBox, string value)
 {
     if (AutoItX.ControlFocus(mainWindow, textBox) == AutoItXSuccess)
     {
         InputSimulatorUtils.EnterKeysByVirtualKeyboard(value, true);
     }
 }
コード例 #2
0
ファイル: RobotCMB.cs プロジェクト: lhunnelSpiral/MyProject
        private void FillSameBankTransInfo(IntPtr mainFormWindow, RobotContext context)
        {
            IntPtr textToAccountName = AutoItX.ControlGetHandle(mainFormWindow, "[CLASS:TCMBStyleEdit; INSTANCE:2]");

            EnterTextBox(mainFormWindow, textToAccountName, context.ToAccountName);


            IntPtr textToAccountNumber = AutoItX.ControlGetHandle(mainFormWindow, "[CLASS:TCMBStyleEdit; INSTANCE:3]");

            Rectangle mainWindowPosition = AutoItX.WinGetPos(mainFormWindow);
            Rectangle refElementPosition = AutoItX.ControlGetPos(mainFormWindow, textToAccountNumber);
            int       startX             = mainWindowPosition.X + refElementPosition.X;
            int       startY             = mainWindowPosition.Y + refElementPosition.Y;
            int       elementPossitionX  = startX + 20;
            int       elementPossitionY  = startY + 20;

            AutoItX.MouseClick("LEFT", elementPossitionX, elementPossitionY);


            InputSimulatorUtils.EnterKeysByVirtualKeyboard(context.ToAccountNumber, true);

            //IntPtr textToAccountNumber = AutoItX.ControlGetHandle(mainFormWindow, "[CLASS:TCMBStyleEdit; INSTANCE:3]");
            //EnterTextBox(mainFormWindow, textToAccountNumber, context.ToAccountNumber);

            IntPtr searchComboBoxToAccountCity = AutoItX.ControlGetHandle(mainFormWindow, "[CLASS:TCMBSearchComboBox; INSTANCE:1]");

            SearchAndSelectComboBox(mainFormWindow, searchComboBoxToAccountCity, context.ToAccountCity);

            IntPtr textTransferAmount = AutoItX.ControlGetHandle(mainFormWindow, "[CLASS:TCMBStyleEdit; INSTANCE:4]");

            EnterTextBox(mainFormWindow, textTransferAmount, context.WithdrawAmount);

            IntPtr textPostscript = AutoItX.ControlGetHandle(mainFormWindow, "[CLASS:TCMBStyleComboBox; INSTANCE:1]");

            EnterComboBoxBox(mainFormWindow, textPostscript, context.BoTransactionId);

            ClickButton(mainFormWindow, 350, 640); // click 'Next' button
            int warningHappen1 = AutoItX.WinWaitActive("[CLASS:TPbBaseMsgForm]", "选择的收款方地址与收款方账户所属开户地不符", 10);

            if (warningHappen1 == AutoItXSuccess)
            {
                IntPtr warningPopWin1 = AutoItX.WinGetHandle("[CLASS:TPbBaseMsgForm]", "选择的收款方地址与收款方账户所属开户地不符");
                ClickButton(warningPopWin1, 300, 150);
            }
        }