Mega Code Archive

 
Categories / Delphi / Examples
 

Detect if delphi is running

If you plan to deploy a component or application for demo purposes, you may want to have it run only if the Delphi IDE is loaded. The following piece of code checks this: if (FindWindow('TApplication', nil) = 0) or (FindWindow('TAlignPalette', nil) = 0) or (FindWindow('TPropertyInspector', nil) = 0) or (FindWindow('TAppBuilder', nil) = 0) then begin ShowMessage('Delphi is not running!'); end