Solved

How can I detect the Delphi IDE is running

Posted on 2003-11-05
18
938 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:matrixworld
  • 5
  • 5
  • 3
  • +3
18 Comments
 
LVL 5

Expert Comment

by:arjanh
ID: 9685719
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
 
LVL 5

Expert Comment

by:arjanh
ID: 9685724
Oops - strike that, I didn't read your second sentence. Sorry.
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9685734
begin
  if DebugHook<>0 then
    ShowMessage('Running in Delphi IDE');
end.
0
 

Author Comment

by:matrixworld
ID: 9685739
Hi arjanh,
   Sorry, I already mention that I need the answer without using FINDWINDOW Command. Thanks
0
 

Author Comment

by:matrixworld
ID: 9685805
Hi arjanh,
   DebugHook is not working if I running my appliction directly without calling from Delphi.
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9686018
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
 
LVL 17

Expert Comment

by:geobul
ID: 9686372
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
 

Author Comment

by:matrixworld
ID: 9691174
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:swift99
ID: 9691735
Check out the design interface.  This should give you some clues.
0
 

Author Comment

by:matrixworld
ID: 9691779
Hi Swift99,

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

0
 
LVL 5

Expert Comment

by:arjanh
ID: 9692471
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
 
LVL 3

Expert Comment

by:ThoseBug
ID: 9693459
if FindWindow('TAppBuilder', Nil) <> 0 then
  ShowMessage('Delphi or C++ Builder is runing) else
        ShowMessage('Delphi or  C++ Builder not runing);
0
 
LVL 6

Expert Comment

by:swift99
ID: 9694080
It's in your VCL source that came shipped with Delphi.
0
 

Author Comment

by:matrixworld
ID: 9698341
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
 
LVL 2

Expert Comment

by:DeNavigator
ID: 9700313
[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
 
LVL 6

Accepted Solution

by:
swift99 earned 30 total points
ID: 9701451
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 104
Correct Component for Shopping Cart. 2 96
Run video youtube webbrowse 10 57
Not able to call Delphi XE10 dll function from Delphi 6.0 4 17
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now