Jump to content
Sign in to follow this  
GuyC

Send keystrokes to a hidden window

Recommended Posts

GuyC

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.

Share this post


Link to post
Share on other sites
Mat

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.

Share this post


Link to post
Share on other sites
GuyC

Thanks.

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

Share this post


Link to post
Share on other sites
Mat

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...

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.