Window with no title - how to press the OK button

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
zeke
Newbie
Posts: 11
Joined: Thu Dec 08, 2005 7:23 pm

Window with no title - how to press the OK button

Post by zeke » Thu Oct 12, 2006 1:18 am

I am trying to use MS to automate the installation of Adobe Flash player 9.0.

I get to a point in the installation where a window box pops up with no title - this is relevant. There is an informational "i" symbol inside of the dialog box with the words Uninstallation Complete and a button that says OK. If I manually push the OK button the installation proceeds.

My problem is how to automate that push OK button. PushButton, WaitforWindow all seem to require a window title. In my case the window title is blank - all I see is a blue border - no wording at all.

Can anyone suggest how to proceed.

Here is the code so far:

Let>RP_WAIT=1
Let>PathtoFlash8a=C:\WINDOWS\system32\Macromed\Flash\Flash8a.ocx
Run Program>%sys_dir%\regsvr32.exe /s /u %PathtoFlash8a%
Run Program>"\\bcscnet.ca\dfs\dist\apps\CLIENT\Adobe\Adobe Flash\Version 9.0\uninstall_flash_player.exe" /silent
Press Enter this is where I am having a problem with that OK button, I need to have the OK button pushed to continue
Run Program>%sys_dir%\msiexec.exe /i "\\bcscnet.ca\dfs\dist\apps\CLIENT\Adobe\Adobe Flash\Version 9.0\install_flash_player_active_x.msi" /qb

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Thu Oct 12, 2006 2:11 am

You might try

let>WIN_USEHANDLE=1
SetControlText>Window Handle,ClassName,Instance,NewWindowText
then...
pushbutton>NewWindowText,OK

I have used this technique before when I have to manage multiple instances of the same exact window name.

I can probably grab a code example from a customer site if you need it...it will take a day or two to get it.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Oct 12, 2006 6:57 am

Zeke,

First of all you will never be able to press the button because you are using RP_WAIT=1. This tells the script to wait until the program launched with Run Program has TERMINATED before continuing. So after the Run Program line the application won't even be there any more. The script is held up intil it exits.

I would recommend you use RP_WAIT=2 (wait until *READY*) AND WaitWindowOpen to wait for the App's window to appear before continuing:

Let>RP_WAIT=2
Run Program>bla.exe
WaitWindowOpen>dddd

You may find you can now just send the enter key to the window. Send tab to move from field to field, and Enter to press a button.

For the case of a window with no title, what I would do is 1. Wait for the foreground window to change (become something else) and then 2. get the foreground window's handle:

//do something to cause the title-less window to appear
WaitWindowChanged>10
Let>WIN_USEHANDLE=1
GetActiveWindow>hWnd,x,y

Then you have the window's *handle* and you can use SkunkWorks' suggestion and change the window's title, if needs be.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts