Jump to content
Sign in to follow this  


Recommended Posts


Hi i am writing a program to install a printer

This is what i have so far

Run ("RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter2)
ControlClick ("Add Printer Wizard","Finish","12325","left",1)

as you can see i haven't got very far. The ControlID is for the next button but it dosn't work nothing happens?

can anyone help

Share this post

Link to post
Share on other sites

Your code isn't waiting for the window to appear before trying to click the control. This should work better:

Run('RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter2')
WinWait('Add Printer Wizard', 'Finish')
ControlClick('Add Printer Wizard', 'Finish', 12325)

I removed the extra parameters to ControlClick() in my example since they default to those values anyway.

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