Push The Freakin' Button! (V1.04, November 1998)

A freeware dialog button-pushing utility for Win9x, NT4(SP3) by P. A. Roberts.

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

This is an update of version V1.03 (originally posted in June 1998).

Contents

What’s New?
Introduction
Main Features
About PTFB
Installation
Using PTFB
PTFB Limitations
Disclaimer

What’s New?

This is an update to version 1.03, which was posted to www.hotfiles.com in June 1998. It contains the following changes and improvements, following feedback for existing users:

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 Win95 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 any folder of your choice.
  2. Optionally make a shortcut to PTFB and put in your Windows\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 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.

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 hilighted. 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.04 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 hilighted 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:

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

The "Basic Options" tab displays the window caption and information about the button to be pressed. More importantly, it allows you to alter the delay before PTFB presses the target button. 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 how busy your machine is. The default setting is 5 secs. When PTFB is on a count-down to pressing a button, the background of its task bar 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 dialog contents.

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.

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

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!