Archive

Posts Tagged ‘delphi ide’

How to Find Out if Delphi is Running

December 15th, 1999 m3Rlin No comments

You may want your program to check if Delphi is running. Well, if so try out this code. This is the method for programs:

function IsDelphiRunning: Boolean;
begin
  Result := (FindWindow('TAppBuilder', nil) > 0);
end;

If you want to check if Delphi is running and you are creating VCL components then you should check for the csDesigning flag.
Here’s the code:

  if csDesigning in ComponentState then
    { Delphi IDE is running }
  else
    { Well, Delphi IDE is not running... }

How to Automatically Create Implementation Declarations

December 15th, 1999 m3Rlin No comments

Delphi 4 and newer (versions Client/Server and up) have the capability of automatically creating declarations for functions/procedures. The key shortcut is Shift + Ctrl + C. To use it you have to enter the function/procedure declaration in the interface part and the press the above mentioned keystroke combination. The Delphi IDE will take care of the rest. It will add the necessary code. If the implementation is part of a class Delphi will recognize this and add the code at the end of the class, not at the end of the source code.