Solved

How can I detect the Delphi IDE is running

Posted on 2003-11-05
18
944 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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
 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Mdi application Child forms get behind control 7 208
Run video youtube webbrowse 10 61
select query - oracle 16 100
Firemonkey android show image from resource ? 1 41
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 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

9 Experts available now in Live!

Get 1:1 Help Now