How to know when the application is run from the IDE? lazarus / 13-General ---------------------------------------------------------------------- gerardus · 2016-05-18 15:18 Hi all, in Delphi I use two functions to check if the application I am working on is being run from the IDE: function IsDebuggerActive : boolean; begin   Result := DebugHook >= 1; end; function DelphiLoaded : boolean; begin   Result:=FindWindow('TAppBuilder', nil) > 0; end; Is there a way to do this in Lazarus? Best regards, Gerard. ---------------------------------------------------------------------- gerardus · 2016-05-19 08:33 Replying to myself: - The Lazarus main window class name appears to be "Window", so not much luck here - There is a isdebuggerpresent() function in the Windows API, but no idea if there is something similar in Linux. Easier solution: use conditional defines. ---------------------------------------------------------------------- vfclists · 2016-05-20 06:50 Quote from: gerardus on May 19, 2016, 10:33:20 amReplying to myself: - The Lazarus main window class name appears to be "Window", so not much luck here - There is a isdebuggerpresent() function in the Windows API, but no idea if there is something similar in Linux. Easier solution: use conditional defines. Another option is to set a command line parameter and check for it at runtime. That also gives more flexibility as it gives you more debugging related facilities you can check for. ---------------------------------------------------------------------- gerardus · 2016-05-20 09:31 Yes, it's an option, but one I wouldn't like to forget once the app goes into production as it bypasses quite a few processes and security checks to speed up user interface testing.    When compiled with TESTING defined, there are many visual warnings that are impossible to miss. Thanks, Gerard.