Push The Freakin' Button! (V1.06.3, March 2001)

A freeware dialog button-pushing utility for Win9x (including Millenium), NT4, and Windows 2000 by P. A. Roberts.

This is an update to version 1.06, which was posted to www.hotfiles.com in January 2001

E-Mail: PTFB@bobos.demon.co.uk
Website: www.bobos.demon.co.uk/par/

Contents

What’s New?
Acknowledgements
Introduction
Main Features
About PTFB
Installation
Using PTFB
Application-Wide Options
PTFB Limitations
Disclaimer

What’s New?

My apologies to AOL users - PTFB 1.06 did not fix the the problems with AOL6 as I'd hoped.

This new version features a button-pushing technique that should (finally) restore PTFB's ability to handle AOL dialogs. As a side-effect of this change, PTFB is now able to press other window controls such as close/minimise/maximise boxes (via button recognition override), so it may be of interest to non-AOL users too. Another change in this version is the ability to set the default press delay for new entries (see the section on PTFB Options).

NT4/2000 users might like to try the beta version of PTFB Admin, which will be available for download from Friday March 16th 2001 at this address: http://www.bobos.demon.co.uk/par/ptfbadmn.htm. This new application is based on PTFB, but offers the following additional features:

Acknowledgements

I'd like to thank everyone who's sent in feedback and suggestions, especially Michael Wilkerson who's been a great help with the AOL problems.

Introduction

When I commit my PC to time-consuming task, I generally wander off for a coffee, thinking that all will be done when I get back. I mean, I don't sit and watch paint dry, I don't stare in fascination at the washing machine, so why should I marvel at the hourglass cursor and a progress bar?

All too often, I return to find that the task has not completed, because something - either Windows itself or the application I'm using - is waiting for me to respond to a simple dialog.

Admittedly, there have been developments to reduce this kind of irritation. TweakUI can get rid of the Win9x logon dialog, and there are utilities that can deal with some of the internet connection dialogs. But there are still plenty of dialogs that slip through the net, to the frustration of more experienced users.

"Push The Freakin' Button" (or PTFB for short) is my attempt at a solution to this problem. This document describes PTFB in detail, although I'm hoping that the explanatory text within PTFB's screens are clear enough.

Main Features

About PTFB

PTFB is a small application that runs in the background - usually its only on-screen presence is a mouse-shaped task bar icon.

When a dialog causes irritation, you simply tell PTFB which button should be pressed, and it will handle the dialog in future.

By default, PTFB is cautious - a dialog has to be a perfect match for its hitlist entry before any buttons will be pressed. But it can be set to be less strict, allowing a range of similar dialogs to be handled from one hitlist entry.

Installation

Installing for the First Time

To keep the download size small, PTFB doesn't have its own installer, but the installation process is simple:

  1. Copy PTFB.EXE to a folder of your choice.
  2. Optionally make a shortcut to PTFB and put in your Start Menu\Programs\StartUp folder, so that PTFB runs automatically each time you boot your PC.

Updating an Existing Installation

This new version of PTFB will keep all your existing settings, so long as you put it in the same location as the old version. Please follow these steps:

  1. If PTFB is currently running (the mouse icon is in the Task Bar tray), open it up and press the Quit button. (Windows will not let you overwrite an application whilst it is running).
  2. Copy the new PTFB.EXE file into the same directory as the existing installation, overwriting the old version.

Moving PTFB

PTFB doesn’t make any changes to the system registry, so you’re free to relocate it if you wish. The important things to remember are:

Using PTFB

Starting PTFB

Whenever PTFB is running, it places a small mouse-shaped icon in your task bar. If the icon isn't present, double-click on PTFB.EXE to start it up. Alternatively, you can get PTFB to start every time you boot your PC - see step (2) of Installing for the First Time.

Configuring PTFB - Main Screen

You can't do much with PTFB until you've added some dialogs to its hitlist. The next time an offending dialog appears, either double click on the mouse-shaped icon in the task bar, or right-click on the icon and choose "Open" from the resulting menu. This brings up PTFB's main configuration screen.

The Main Screen

From top to bottom, the screen has:

To put a new entry into the hitlist, click on the button-selection tool (hand) and drag it over the appropriate button on the offending dialog. When the tool is over a button that it can press, the "finger" is hilighted slightly. Letting go of the tool at this point will add a new entry to the hitlist. If PTFB fails to acknowledge a button (the finger does not become hilighted) then you may need to override PTFB's default behaviour.

To change the settings for a particular entry, either select the list item and hit the Edit button, or simply double-click the list item.

To permanently remove an entry from the hitlist, select the appropriate list item and hit the Delete button. If you’d rather disable an entry temporarily, just click on its checkbox to remove the tick mark. PTFB will ignore that entry until it is re-enabled, by clicking on the checkbox to restore the tick.

To put PTFB into action, click the Start Watching button, or use the window's close-box in the top right hand corner.

When PTFB doesn't acknowledge a button

Sometimes, PTFB may not acknowledge the target button - the finger does not become highlighted. This is often because the button is either highly customised, or does not exist as a true button control. To help deal with at least some these cases, PTFB 1.06 has a facility for overriding the normal button recognition rules.

To use this facility, hold down both the left and the right mouse buttons as you drag the finger cursor. You'll notice that the finger appears highlighted all the time, and PTFB's main window displays the current mouse coordinates. When the cursor is over the target button, be sure to release the left mouse button first. At this point, if PTFB still can't recognise the button it will ask you to confirm that you want to add a hitlist entry:

Override Confirmation Dialog

If you respond with "Yes", then a new hitlist entry will be created, but the target button will be described by a mouse position rather than by a button name. When PTFB next sees the dialog, it will apply all the validation tests described in the following section "Changing Settings for a Hitlist Entry". If the dialog passes, PTFB will simulate a mouse click at the button location. Please note that there's no guarantee that the dialog will react as though the button had really been pressed, but the technique does allow PTFB to work for a much wider range of dialogs.

Changing Settings for a Hitlist Entry

To change the settings for a particular entry, either select the list item and hit the Edit button, or simply double-click the list item. This brings up a tabbed dialog displaying the entry's current settings. The dialog has three tabs: "Basic Options", "Advanced Options" and "Info"

Basic Options

Edit Item: Basic Options

The "Basic Options" tab allows you to:

The entry title defaults to the same text as the main window caption. You can change the title to help differentiate this entry from any others on the hitlist.

The "action" section allows you to choose how PTFB should press the target button. By default PTFB uses a simulated mouse click, but it can also press the button using a hotkey (short key combination indicated by an underlined character on the button's text). This has feature has been requested by a number of users, and may prove useful in cases where the simulated mouse click action is ineffective. To use the hotkey technique, just select the "Use hotkey" radio button and verify that the key combination is correct. If you want to change the hotkey combination, just press the "Set..." button and type required keys.

Additionally, if you tick the "Allow action to repeat" checkbox, PTFB will repeat the press action for as long as the target can be found. Note that the press delay (see below) is also repeated - if the delay is ten seconds, the target button will be pressed every ten seconds.

The press delay can be set for any period from 0 secs up to 4 hours. This setting is only approximate - if you set the delay to 0, PTFB will usually press the button in less than a second, depending on machine load and PTFB's current response speed. The default delay is 5 secs. When PTFB is on a countdown to pressing a button, the background of its system tray icon changes to red.

Advanced Options

This page is split into two sections. The upper section allows some flexibility in identifying the dialog on which the target button resides, while the lower section offers analogous features for the window contents.

Edit Item: Advanced Options

Identifying Main Window

By default, PTFB insists on an exact match between the title on the hitlist and the title of any candidate dialog. This setting, labelled "Match entire title", is the safest of the two, but it's also the most restrictive. There are quite a few dialogs whose titles are dynamic - that is, some portion of the title changes according to the context. For example, it's not uncommon for internet browsers to report "xxxx downloaded successfully" where xxxx is the name of a file.

Fortunately, PTFB offers a second option labelled "Require this text". To the right of this option is an edit box in which you can specify an unchanging portion of the dialog title. As long as PTFB sees this text in a dialog title, that dialog is half way to having one of its buttons pressed! Following on from the earlier example, you might enter "downloaded successfully" to cover a range of virtually identical browser notification dialogs.

Identifying Window Contents

Some dialogs have the same title, the same buttons, but a different meaning and effect. It's rarely enough to use just the dialog and button titles to identify an entry, and it could be dangerous if PTFB started pushing the wrong buttons. At the same time, PTFB would be rather limited if it couldn't handle simple variations within a dialog. For this reason, PTFB offers three checking levels for the window contents:

  1. Strict Checking. This is the default setting, and causes PTFB to check everything in a dialog, even invisible items, before it decides to press any buttons. To see the full list of items that will be checked for this option, flip to the third tab "Info" (see below) and look through the list.
  2. Simple Checking. This is the least rigorous setting. PTFB only looks at the dialog title and the text on a button - if these match the entry, then the button gets pushed! This setting should be used with care, and only if you're sure that the dialog and button title combination is fairly unique.
  3. By Prompt. This sits between the first two settings, allowing some flexibility without abandoning all safety. PTFB identifies the entry using not only the dialog and button captions, but also a snippet of text from the dialog. The text is entered in the combo-box below the By Prompt option. To help you enter the text, the combo contains all visible prompt text within the dialog, so you can pick the string you want to use and edit it, if necessary. Note that text case is used during comparison.

I personally find "By Prompt" checking to be the most useful option, so here's an example:

Let's say you regularly backup the "saved game" files of your favourite, but rather buggy game, by copying them from one location to another. Windows dutifully asks you to confirm your intention to replace your existing backup files (that haven't changed). You always want to say "Yes", but only for this set of files, which all have the ".sav" extension. One solution is to target the dialog with PTFB, but use the "By Prompt" option with a text string of ".sav".

Info

This page just displays information about the contents of the window, and is not editable.

Edit Item: Info

Enabling/Disabling PTFB

The mouse-shaped task bar icon shows PTFB's current state. If the icon shows only the mouse, then PTFB is enabled and is on the lookout for any dialogs on its hitlist. If the icon has a red no-entry sign on it, then PTFB is disabled; it won't press any buttons and won't take any processor time.

To switch PTFB from enabled to disabled or vice versa, just right-click on the mouse icon and choose from the resulting menu.

Note: PTFB is always disabled when its configuration screen is present.

Application-Wide Options

Following a number of requests, PTFB now offers control over some of its internal settings, such as the overall response speed and the default press delay for new entries. To gain access to these settings, open up PTFB's main window by double-clicking on the mouse icon in the system tray (or by right-clicking and choosing Open from the menu). Now click on the mouse icon in the top-left of PTFB's main window, or hold down the ALT key and tap the space bar. This displays PTFB's system menu, as shown below:

PTFB System Menu

Choose "Set Options" from the menu to display the following property sheet:

PTFB Global Properties

PTFB Response Speed

PTFB is not constantly active - it operates on a cycle. At the start of the cycle, it searches for target buttons and presses them if appropriate. The rest of the cycle is spent "sleeping", in order to minimise its effect on your computer's performance.

This affects how quickly PTFB can detect and press targets with a zero-second delay. For example, if the target appears while PTFB is asleep, nothing will happen until the start of the next cycle. The default cycle length is one second, so some no-delay targets may have to wait almost a second before they are handled.

PTFB now offers a facility for reducing the cycle time, increasing response speed at the expense of slightly higher processor usage. This is particularly useful in cases where an application issues a long sequence of dialogs, and you just want PTFB to fire through them as quickly as possible.

The default response setting is "Slow", which corresponds to a one-second cycle time. Move the slider towards the "Fast" setting to increase the response speed.

Note that on most recent computers, even the fastest setting makes no appreciable difference to system performance, but it may be more of an issue if your computer is working flat out on a time-critical task.

Default Press Delay

Use this setting to determine the initial press delay for each new entry in the hitlist.

 

PTFB Limitations

  1. Some dialogs look as if they are dismissed when you hit a button, but are in fact merely hidden. PTFB takes care to avoid rampant re-pressing in these cases - it will only press a button once on each appearance of its owning dialog.
  2. The button recognition override (right mouse button) always allows a new entry to be added to the hitlist, and PTFB will simulate a button press as required. Even so, there's no guarantee that the simulated button press will work in all cases.


Disclaimer

PTFB was written initially for myself, but was later put to good use at work, to help automate unattended E-Mail dial-ins. It's not as polished as I'd like, and certainly hasn't been tested to destruction.

But it's free, and if it helps anybody else out there, then that's fine by me. Equally, if you tell PTFB to press Yes when the "Format Drive C?" dialog comes up, don't blame me when your data gets flushed. Use entirely at your own risk, I accept no responsibility for any damages caused directly or indirectly through the use/misuse of PTFB.