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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access