12Ghosts.com | Download | Order | Support 

12Ghosts WinControl

12Ghosts - WinControl


What does it do for me?

Control and manipulate windows with one click (or use a shortcut, timer, or batch file). Resize and position windows. Close or terminate programs if they don't respond. Check automatically for not-responding applications and restart them. Send keys or a complete text to other windows.

Set the size and position of a window, for example to test your web pages at 800x600. Quickly and exactly position windows that don't keep their position, for example Notepad or Internet Explorer. You may also maximize, minimize, restore, or center a window with one click. You may also hide windows, get them to the front, or keep them on top of all other windows.


Where should I start?

After starting 12-WinControl you first need to specify with which window you'd like to work. Click on the upper little flag and drag it over the window. The Window Title should be the same now, the Window Class is of interest later.

Let's assume you have an Internet Explorer window open and want to position it top left and resize it to exactly 850x735 so that it perfectly fits on your screen while not taking too much space. Drag the upper flag over the Internet Explorer window. Title should be "<something> - Microsoft Internet Explorer" and the class "IEFrame".

Click on Maximize and Restore to test if it works. Now enter the position and size you want and click on both Move and Size.


Move and Size Remotely

You may want to know the exact position of a window. Just drag the lower flag over the window of that you want to know the size and position. You may also get the size of child windows (buttons, edit boxes, etc.) but you can't resize or move child windows.

Note: A full screen window on a 640x480 screen does not have the size of 640x480! This is because the borders of a full screen window are outside the screen, but they are still there. So the full screen buttons add the current frame size (usually eight points) and then set the size correctly.


Close or Terminate

Select Close to try closing the window in a "friendly" manner. This will ask the window to save data if it has unsaved data. In that case, the window will not close.

If there are several instances of a window select Close All. This will search for all windows matching the name and class and close them.

To close an application, regardless if it has unsaved data or not, and regardless if the application is hanging, select Terminate. You should carefully read the warning! Unsaved data will be lost. (You may suppress the warning on the command line with the /nowarning option.)



A shortcut can be created that will do the same what you did manually. As with all shortcuts, you can enter a hotkey to start the shortcut. However, for the hotkey to work you need to keep it either on the desktop or within the Start menu! (Try 12-Quick to start shortcuts fast.)

In the above example, the Window Class field specifies any Internet Explorer window (the first that it finds). Only if a Window Title is given that particular window is moved or resized.

If you specify an exact "Window Title" here, the shortcut will only work for that window. But if you leave the field "Window Title" empty, and then create the shortcut, the shortcut can be used with every window of the same class, for "IEFrame" that is any Internet Explorer window.


Batch Commands

The easiest way to create a shortcut with the correct command line parameters is to click on the button Shortcut. Use the following commands in batch files, shortcuts, or for example, when calling 12-WinControl from 12-Robo.

/N'<Title>' Window Title (Name). Text at the top of each window, in the blue bar
/C'<Class>' Window Class. Every window belongs to a certain type, or "class". This way you can control any Internet Explorer window, for example, and not just a specific one.
/Lnn Left. Distance, in points, from the left edge of the screen.
/Tnn Top. Distance, in points, from the top edge of the screen.
/Wnn Width in points.
/Hnn Height in points.
/close Close the window. The window can still save data.
/closeall Close all windows that match then title and/or class
/terminate   Definitely stop the application to which the window belongs. The application can not save unsaved data.
/nowarning    No Warning. Only used in conjunction with /TERMINATE. No warning message will be displayed if the window does not respond to a last "friendly" close inquiry. The application will be closed without saving user data.
/min    Minimize the window.
/max    Maximize the window.
/center    Center the window.
/restore    Restore the window.
/hide    Hide the window.
/unhide    Unhide the window.
/top Activate window
/bottom Send window behind all others
/ontop Keep on top
/notontop No longer on top
/pause:s Wait s seconds
/sendkeys:string send 'string'


Example 1: Start and Position in One Step

Let's assume you want to open a web page and set its size and the position of the Internet Explorer window and that all in one command.

First, create a batch file: create a new text file and change the extension from ".txt" to ".bat" when you save it. The file should have two lines, the first opens Internet Explorer, the second starts WinControl in order to set the position. The following example would open the CNN homepage and place it in the upper left corner:

start http://www.cnn.com/
"C:\Program Files\12Ghosts\12wincontrol.exe" /C'IEFrame' /L2 /T2 /W850 /H735 /pause:1

The DOS command start will open your default browser and continue with the batch file without waiting for the browser to close.

The class 'IEFrame' is the class of the Internet Explorer window. For any other window you can easily find out the class by dragging the upper flag of 12-WinControl over the specific window.

Let 12-WinControl create the second line for you: First open the Internet Explorer manually, drag the upper flag over the IE window, empty the Window Title field (so that it works with any window title), and enter the correct size and position. Then click on "Create Shortcut", switch to the desktop, right-click on the new shortcut, select Properties, then Shortcut, and finally copy the Target line of the shortcut to your batch file.


Example 2: Open Two Web Pages at Different Positions

Here is our special: open several web sites and position the windows all over the screen. In this example we open two sites but you could add as many as you need. (Read Example 1 first if you haven't yet.)

To open more than one IE window you need to start iexplore.exe directly (see below). There is another problem to tell the DOS command "start" what we want. Add another parameter in double quotes (it doesn't matter what you write there) so that the second parameter is indeed used as the program to start and the rest as the site to open.

 Finally, you need to tell 12-WinControl which window to set if you have more than one open. You may use *any* part of the title bar. For example, /N'cnn' for the www.cnn.com site, as in the following example:  

start "nix" "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://www.cnn.com/
"C:\Program Files\12Ghosts\12wincontrol.exe" /N'cnn' /C'IEFrame' /L2 /T2 /W850 /H735 /pause:1
start "nix" "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://www.abc.com/
"C:\Program Files\12Ghosts\12wincontrol.exe" /N'abc' /C'IEFrame' /L200 /T200 /W850 /H735 /pause:1


See also: How to Record Internet Radio using 12-WinControl and 12-Timer


Check for not-responding apps

You want to make sure an application is always running? Use 12-WinControl to check every x seconds for hanging applications and restart them if they are not reponding. Set the time to wait until the application is considered not-responding. That application is going to be terminated, and the specified program is (re-)started.

As usually, select the application you want to check for by dragging the little flag over its window.


Send keys

In the SendKeys dialog box you can simply type the keys you'd like to send. 12-WinControl will remember the key sequence until the next time. You may as well call WinControl with the new parameter /sendkeys:string from any shortcut or batch file.

For capitalized letters, control keys, or ALT+key combination use +, ^, or %. For example:

Use +b for B (capital)
^D for Ctrl+D
%X for Alt+X

Use {WAIT:nn} to pause for nn seconds.

Some special keys are not represented by a character. You can use one of the following keywords in braces.

{LBUTTON} Left mouse button
{RBUTTON} Right mouse button
{MBUTTON} Middle mouse button
{CANCEL} Control-break processing
{BACKSPACE} Backspace
{TAB} Tab
{RETURN} Return/Enter
{SHIFT} Shift (capital)
{PAUSE} Pause
{CAPITAL} Capital lock
{ESC} Escape
{SPACE} Space
{PRIOR} Page up
{NEXT} Page down
{END} End
{HOME} Home
{INSERT} Insert
{DELETE} Delete
{LEFT} Left arrow
{UP} Up arrow
{RIGHT} Right arrow
{DOWN} Down arrow
{SNAPSHOT} Print key
{LWIN} Left Windows key
{RWIN} Right Windows key
{CONTEXT} Context menu/apps key
{F1} - {F24} Function keys F1 to F24
{NUMLOCK} Numlock
{SCROLL} Scroll



12Ghosts Power Tools

© 1993-2014 12Ghosts Inc. All rights reserved.