Jump to content

Send keystrokes to a hidden window


Recommended Posts

Hi there,

I'm new here so forgive me for my newbie question.

I have an IIS server which catch remote requests. The server then run SignCode.exe but without GUI (this is the nature of IIS, I think) and I want to communicate with that unvisible window.

So, the IIS runs a script that launches SignCode.exe with the proper parameters and waits for the retval. I want autoit to catch the SignCode window, enter the password and press OK.

I've tried this code:

AutoItSetOption ( "WinDetectHiddenText", 1 )

While 1 // waiting forever for requests

If WinExists("Enter Private Key Password") Then

WinActivate("Enter Private Key Password")

Send("my_pwd")

Send("{ENTER}")

EndIf

Sleep(2000);

WEnd

But no window is being caught and I guess this is because there is no window.

Pls advise.

Thanks,

Guy.

Link to comment
Share on other sites

You are contradicting yourself slightly in saying A: The window is invisible/hidden and B: There is no window.

If it is A, then WinExists will return true (add a message box into the if statement to test that), and it will be possible to enter the information using ControlSend rather than send. If it's B then you have a problem.

Link to comment
Share on other sites

Thanks.

It's probably B (no window) since WinExists returns false...

If the window doesn't exist then you are going to have to find other ways to automate the program... Command line parameters are a good place to start. If you find out what the name of the process is that you want to automate then write a small script that finds all windows belonging to that process then you might get lucky and it will have an window interface (like SciTE does for example)otherwise you have to hope they have some way ofautomating it...
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...