ActivateFirstInstance
procedure OgFirst.ActivateFirstInstance; {32-bit version}
procedure OgFirst.ActivateFirstInstance(const MainWindowCaption, MainWindowClass : string); {16-bit version}
ActivateFirstInstance locates an applications main window and then makes it the active window.
ActivateFirstInstance forces the window with the specified caption and class to the top of the z-Order and gives it the focus. This method is normally called after detecting that a second instance of the application was executed and subsequently halted. Calling ActivateFirstInstance gives the appearance that running the application a second time succeeded.
The 32-bit version of ActivateFirstInstance does not take any parameters and automatically locates the applications main window. The 16-bit version of this routine requires that the class name and caption of the main form be passed as arguments.