Browse Prior Art Database

Change to First Started Instance using Shared Memory

IP.com Disclosure Number: IPCOM000112162D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 39K

Publishing Venue

IBM

Related People

McGuill III, AL: AUTHOR [+4]

Abstract

Disclosed is a method for changing focus to the first instance of a program when a user tries to start a second instance of the same program. The program must recognize that a second instance has been requested, make the first instance active, and terminate the second instance. This is especially important for programs that do not have a "main" window. In these cases, the program can give focus to the active window, instead of just the "main" window.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 81% of the total text.

Change to First Started Instance using Shared Memory

      Disclosed is a method for changing focus to the first instance
of a program when a user tries to start a second instance of the same
program.  The program must recognize that a second instance has been
requested, make the first instance active, and terminate the second
instance.  This is especially important for programs that do not have
a "main" window.  In these cases, the program can give focus to the
active window, instead of just the "main" window.

      When a program is first started, it tries to allocate a
specific named area of shared memory.  If the call is successful, the
handle to the program's window is stored in the shared memory.  The
shared memory (active window handle) is then updated as the active
window changes during program execution.  If the call fails
indicating that the shared memory already exists, then another
instance of the program is already running.  The window handle of the
first instance is then retrieved from the shared memory.  This window
handle is then used to switch focus to the active instance.  Once
focus has been switched, the second instance is terminated.

This concept is unique in the following ways:

o   It provides programmers with a method of changing focus to the
    active instance of a program, even if it does not have a "main"
    window.

o   It saves memory by disallowing several instances of the same
    program to be started.

o   It...