首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Run() AutoIt在x64中不工作

Run() AutoIt在x64中不工作
EN

Stack Overflow用户
提问于 2019-12-24 20:25:36
回答 1查看 192关注 0票数 0

任务:编写一个程序,该程序在单击时只显示3个按钮,模拟在另一个窗口中按下键组合(宏Ctrl+Z)。我在windows x32中开发了应用程序,并尝试在windows x64中运行。

我所做的:我的代码:

代码语言:javascript
复制
Imports AutoItX3Lib

Imports System.Configuration

Public Class Form1
    Dim AutoitCommand As New AutoItX3
    'get setting in app.config. C:\Users\mexal\AppData\Local\Figma\Figma.exe
    Dim RouteExe As String = ConfigurationManager.AppSettings("RouteExe")
    'get setting in app.config. "name - Figma" name - name document that to be opened
    Dim WindowName As String = ConfigurationManager.AppSettings("WindowName")

    Public Sub New()

        'init form
        InitializeComponent()

        'set top position
        TopMost = True

    End Sub

    Private Sub ButtonUndo_Click(sender As Object, e As EventArgs) Handles ButtonUndo.Click

        AutoitCommand.Run(RouteExe)
        AutoitCommand.WinWaitActive(WindowName)
        AutoitCommand.Send("^z")

    End Sub

    Private Sub ButtonRrendo_Click(sender As Object, e As EventArgs) Handles ButtonRrendo.Click

        AutoitCommand.Run(RouteExe)
        AutoitCommand.WinWaitActive(WindowName)
        AutoitCommand.Send("^y")

    End Sub

    Private Sub ButtonSpace_Click(sender As Object, e As EventArgs) Handles ButtonSpace.Click

        AutoitCommand.Run(RouteExe)
        AutoitCommand.WinWaitActive(WindowName)
        AutoitCommand.Send("{SPACE}")

    End Sub

End Class

发生了什么:应用程序在我安装AutoItX3Lib之后启动。好吧。但是当应用程序想按路径启动应用程序的时候,C:\Users\mexal\AppData\Local\Figma\Figma.exe和Figma.exe就会崩溃,但是它的窗口没有显示,并且只在进程中运行。

我做错了什么?

EN

回答 1

Stack Overflow用户

发布于 2019-12-25 00:42:56

在*.cs端重写应用程序--它工作得很好!

前:

代码语言:javascript
复制
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AutoItX3Lib;

namespace ArtistButtons
{
    public partial class Form1 : Form
    {
        AutoItX3 auto = new AutoItX3();
        public Form1()
        {
            InitializeComponent();


        }

        private void ctrlz_Click(object sender, EventArgs e)
        {
            auto.WinActivate("инста - Figma");
            auto.Send("^z");
        }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59473139

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档