Solved

How can I detect the Delphi IDE is running

Posted on 2003-11-05
18
929 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
Comment Utility
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
Comment Utility
Oops - strike that, I didn't read your second sentence. Sorry.
0
 
LVL 5

Expert Comment

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

Author Comment

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

Author Comment

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

Expert Comment

by:arjanh
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 6

Expert Comment

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

Author Comment

by:matrixworld
Comment Utility
Hi Swift99,

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

0
 
LVL 5

Expert Comment

by:arjanh
Comment Utility
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
Comment Utility
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
Comment Utility
It's in your VCL source that came shipped with Delphi.
0
 

Author Comment

by:matrixworld
Comment Utility
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
Comment Utility
[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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

11 Experts available now in Live!

Get 1:1 Help Now