Name

HPrevInst Variable

Syntax

var HPrevInst: Integer;

Description

HPrevInst is always zero. It is an artifact from Delphi 1 and no longer serves any useful purpose.

Tips and Tricks

Most Delphi 1 programs use HPrevInst to determine whether the application is already running. Win32 has many ways of doing the same without using HPrevInst, but knowing whether the application is running is the easy part of the problem. More difficult is knowing what to do: should the new instance send its command line to the existing application? Should the application behave differently when running for the first time than when it is invoked at subsequent times? This book cannot answer these questions for you, but see Chapter 4 for one suggestion for handling this situation.

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.