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... }
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.
Categories: Delphi / Kylix IDE Tags: borland, capability, codegear, ctrl c, declarations, Delphi, delphi 4, delphi ide, function, ide, ides, implementation, interface, keystroke combination, Kylix, necessary code, procedure, procedure declaration, routine, shortcut, source code, tip, trick