Sign in to follow this  
Followers 0
GoogleDude

Send ControlClick to Hidden Window?

7 posts in this topic

#1 ·  Posted (edited)

Can I send a ControlClick function to a window that is hidden via WinSetState("app.exe","", @SW_HIDE)? This is NOT a windows/gui that was made with AutoIt!

I searched in AutoIt Help but all it says is

The control might first need to be given focus with the ControlFocus command.

Simulating a click on a control is only 100% accurate when the control's parent window is active - this is done automatically. Nothing will occurs if the control is disabled.

It doesnt say anything about Hidden Windows!

GoogleDude

Edited by GoogleDude

Share this post


Link to post
Share on other sites



One way to test the idea.

Run('calc')
Sleep(1000)
WinWait('Calculator')
Sleep(1000) ; Hide window with next line
WinSetState('Calculator', '', @SW_HIDE)
ControlClick('Calculator', '', '6')
ControlClick('Calculator', '', '+')
ControlClick('Calculator', '', '6')
ControlClick('Calculator', '', '=')
Sleep(1000) ; Show window with next line
WinSetState('Calculator', '', @SW_SHOW)

:)

Share this post


Link to post
Share on other sites

Yep, worked fine :)


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites

Thanks that did the trick. How can I lunch a MSI hidden? I tried the below but it still wont open hidden.

run ('msiexec /i "' & @TempDir & '\testapp.msi"',"",@SW_HIDE)

GoogleDude

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Silent install MSI

Run('msiexec /i "' & @TempDir & '\testapp.msi" /qn')

Use msiexec /? for help with switches at a command prompt or run box.

Edit:

If you still which to automate it, then use WinMove() to move off screen or use WinSetTrans() to hide it.

Edited by MHz

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Can an MSI be run via the RUN or RunWait function with the @SW_HIDE flag? my MSI has questions that it asks that I can trying to script. And I am trying to make it as close to 100% hidden as I can. Even by moving it off screen it still shows in the task bar.

Thanks,

GoogleDude

Edited by GoogleDude

Share this post


Link to post
Share on other sites

Can an MSI be run via the RUN or RunWait function with the @SW_HIDE flag? my MSI has questions that it asks that I can trying to script. And I am trying to make it as close to 100% hidden as I can. Even by moving it off screen it still shows in the task bar.

...

No, it shows.

You could try WinSetState() and @SW_HIDE on each window but you would get an annoying flicker of just seeing every window.

You could perhaps make a MST file with your setting and silent install it with switches. The options are set out for you. MSI's like to follow what is in their database and the usual method most people may use is to edit the MSI, or create a MST file, or even repack so silent installation is available.

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  
Followers 0