Class TOnlyOne (unit OnlyOne)

Inherits from

TComponent

* * * * * * * * * * * * * * * * * * * * * * * * * * * * OnlyOne, version 1.00, Freeware A Delphi 2.0 component composed by Gary Nielsen, 3/26/96 70323.2610@compuserve.com Drop the OnlyOne component onto a form and only one instance of that window will occur. Any attempt to make a second instance will restore the previous window. caveat artifex: Use this component at your own risk. OnlyOne may not work with applications that change their title bar, or with applications that have names longer than 20 chars. I have only tested this component on a limited number of programs, so treat it as 'alpha'-ware. Acknowledgements: To make this into a component, I used Steven L. Keyser's JustOne component as a template. I also derived some code from PC Mag's Michael J. Mefford's PicAlbum utility, in which hPrevInst is used, but, according to the documentation, hPrevInst always equals NULL with Delphi 2 and Win95. Please, if you modify or enhance this code, drop me a note so that I can learn from your work. 3/28/96 Dion Kurczek - Added EnforceOnlyOne property so you can get stop this behavior when debugging network apps. Also added the DCR :) * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Constructors


constructor Create(AOwner:TComponent);

make the global atom so no other instances can occur


Functions

destructor Destroy;


procedure Loaded;


Properties

property EnforceOnlyOne : boolean


Events

Variables

FEnforceOnlyOne : boolean;



Constructors


constructor Create(AOwner:TComponent);

make the global atom so no other instances can occur


Functions


destructor Destroy;


procedure Loaded;


Properties


property EnforceOnlyOne : boolean


Events


Variables


FEnforceOnlyOne : boolean;