Jump to content

Getting window to appear


henrylee
 Share

Recommended Posts

Hello,

I am currently using AutoItX3 through Ruby and am having some issues.

I am trying to write a script that opens up an application, enters in login credentials, and attempts to log in.

The problem I am running into is that the actual window for the application I want to run never pops up. When I use the Run function, I get a PID and I can see that the correct process is running, but I do not get the window to pop up. 

Any ideas?

Thank you

Link to comment
Share on other sites

Sorry, here's the code (with the details hidden):
 
require 'win32ole'
 
def set_up
   @au3 = WIN32OLE.new ("AutoItX3.Control")
   @au3.opt "WinTextMatchMode", 2
end
 
def open
   pid = @au3.Run('PATH', "", @SW_SHOWMAXIMIZED)
   return pid
end
 
def enter
   @au3.Send "{ENTER}"
end
 
def tab
   send "{TAB}"
end
 
def send s
   warn s
   @au3.Send s.to_s
end
 
set_up
username = "***"
password = "***"
 
pid = open
@au3.WinWaitActive("AppTitle")
send username
tab
send password
enter
@au3.ProcessClose(pid)
Link to comment
Share on other sites

Yes, I see the program running as a process in the Task Manager.

When I pass the exact path into the command line, the program window comes up. Also, when I don't use Ruby and just put the run function into a .au3 file, it opens fine as well.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...