How can I detect the Delphi IDE is running

Hi All,
   How can I detect the Delphi IDE is running when my application is running outside of IDE as Stand-Alone EXE ?
   I need the answer without using FINDWINDOW Command. Thanks
Regards,
MatrixWorld
matrixworldAsked:
Who is Participating?
 
swift99Connect With a Mentor Commented:
Delphi contains the source for the entire VCL, including the design interface.  Many components behave one way when working under the designer, and another way when when working under your application.  

For example, a TDatamodule has a visible window and editors when run under the IDE.  But it has no visible representation in your application.  The code for a TDatamodule is in the VCL source code.  It should have what you need to get started.
0
 
arjanhCommented:
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
0
 
arjanhCommented:
Oops - strike that, I didn't read your second sentence. Sorry.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
arjanhCommented:
begin
  if DebugHook<>0 then
    ShowMessage('Running in Delphi IDE');
end.
0
 
matrixworldAuthor Commented:
Hi arjanh,
   Sorry, I already mention that I need the answer without using FINDWINDOW Command. Thanks
0
 
matrixworldAuthor Commented:
Hi arjanh,
   DebugHook is not working if I running my appliction directly without calling from Delphi.
0
 
arjanhCommented:
For me this does what you'd expect:

  if DebugHook=0 then
    ShowMessage('Running Standalone')
  else
    ShowMessage('Running in Delphi IDE');

But DebugHook is Platform specific. Are you running on Windows or on Linux?
0
 
geobulCommented:
Hi,

Would you explain why the solution should be without using FindWindow? Alternatively you might enumerate all the running processes, get their file names and search for delphi32.exe in that list.

Regards, Geo
0
 
matrixworldAuthor Commented:
Hi Geo,

   If using the FindWindow security to control Trial Version is easy to break it (just using   Windows.RegisterClass  & CreateWindow to break it), and if using running processes to get the file names for DELPHI32.EXE more easy to break it (just create the DELPHI32.EXE), any other solution that can I use it ? Thanks for Help.

Hi Arjanh,

   Your method I try only working if I press F9 to run it can check Delphi IDE is running but I running the Application it self, it told me that the Delphi IDE is not running although Delphi IDE is running. Thanks for Help.

Regards,
MatrixWorld
0
 
swift99Commented:
Check out the design interface.  This should give you some clues.
0
 
matrixworldAuthor Commented:
Hi Swift99,

   How to do it ? Please give the sample code to test it. Thanks.

0
 
arjanhCommented:
MatrixWorld,

So if I got your trial app, I could use it forever if I just start my delphi32 ide on a completely different project?
I would think the best security would be to detect whether or not YOUR project is running in the IDE.... And then the DebugHook works.
0
 
ThoseBugCommented:
if FindWindow('TAppBuilder', Nil) <> 0 then
  ShowMessage('Delphi or C++ Builder is runing) else
        ShowMessage('Delphi or  C++ Builder not runing);
0
 
swift99Commented:
It's in your VCL source that came shipped with Delphi.
0
 
matrixworldAuthor Commented:
Hi Swift99,
   What you mean the VCL source came together with Delphi ? If I wrote my own Component or Application that able to detect Delphi IDE, how do I check the design interface ? Thanks
0
 
DeNavigatorCommented:
[quote]
 Your method I try only working if I press F9 to run it can check Delphi IDE is running but I running the Application it self, it told me that the Delphi IDE is not running although Delphi IDE is running. Thanks for Help.
[unquote]
But this i what you want, is it not?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.