IDE Only

I did a complete search and could not find an answer, so I'm posting to see if anyone knows.

I need a way to determine if the IDR is running in Delphi 2007. I have some code I do not need executed while I'm programming/debugging the application.

I have code that worked for Delphi 7, but does not work properly with Delphi 2007. It's a simple code that looks at window titles, see below

*NOTE: Bug in forum won't let your show correct array code, converts to URL*

function DelphiRunning : boolean;
var
   H1, H2, H3, H4 : Hwnd;
const
   A1 : array(0..12] of char = 'TApplication'#0;
   A2 : array(0..15] of char = 'TAlignPalette'#0;
   A3 : array(0..18] of char = 'TPropertyInspector'#0;
   A4 : array(0..11] of char = 'TAppBuilder'#0;
   T1 : array(0..6] of char = 'Delphi'#0;
   T2 : array(0..8] of char = 'Delphi 2'#0;
   T3 : array(0..8] of char = 'Delphi 3'#0;
   T4 : array(0..8] of char = 'Delphi 4'#0;
   T5 : array(0..8] of char = 'Delphi 5'#0;
   T6 : array(0..8] of char = 'Delphi 6'#0;
   T7 : array(0..8] of char = 'Delphi 7'#0;
   T8 : array(0..12] of char = 'CodeGear RAD'#0;
begin
   Result := True;
{$ifndef ELREG}
   H1 := FindWindow(A1, T1) + FindWindow(A1, T2) + FindWindow(A1, T3) + FindWindow(A1, T4) + FindWindow(A1, T5) +
         FindWindow(A1, T6) + FindWindow(A1, T7) + FindWindow(A1, T8);
   H2 := FindWindow(A2, nil);
   H3 := FindWindow(A3, nil);
   H4 := FindWindow(A4, nil);
   Result := (H1 <> 0) and (H2 <> 0) and
             (H3 <> 0) and (H4 <> 0);
{$endif} {ELREG}
end;

Thanks for any help you can give.
Jimmy
0
Jimmy
8/23/2008 10:39:36 AM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

3 Replies
1344 Views

Similar Articles

[PageSpeed] 36
Get it on Google Play
Get it on Apple App Store

I normally verify 'debughook' variable...
0
sergio_ag
8/23/2008 12:50:12 PM
As the other reply says, better just check DebugHook (if it isn't 0
then the app is being run under the debugger).  I'd guess that the
reason your code doesn't work is because FindWindow finds top level
windows, and the object inspector at least need not be such a window,
with or without the embedded designer (I myself dock it in with the
structure pane, for example, even in D7).

Other than that, and this is just an observation, but do you know that

  const
     A1 : array[0..12] of char = 'TApplication'#0;

is equivalent to

  const
     A1 : PChar = 'TApplication';

and even

  const
     A1 = 'TApplication';

(string true consts are assignment-compatible with both string and
PChar).
0
Chris
8/23/2008 2:05:57 PM
Jimmy Traylor wrote:
> I did a complete search and could not find an answer, so I'm posting to see if anyone knows.
> 
> I need a way to determine if the IDR is running in Delphi 2007. I have some code I do not need executed while I'm programming/debugging the application.
> 
> I have code that worked for Delphi 7, but does not work properly with Delphi 2007. It's a simple code that looks at window titles, see below
> 
> *NOTE: Bug in forum won't let your show correct array code, converts to URL*
> 
> function DelphiRunning : boolean;
> var
>    H1, H2, H3, H4 : Hwnd;
> const
>    A1 : array(0..12] of char = 'TApplication'#0;
>    A2 : array(0..15] of char = 'TAlignPalette'#0;
>    A3 : array(0..18] of char = 'TPropertyInspector'#0;
>    A4 : array(0..11] of char = 'TAppBuilder'#0;
>    T1 : array(0..6] of char = 'Delphi'#0;
>    T2 : array(0..8] of char = 'Delphi 2'#0;
>    T3 : array(0..8] of char = 'Delphi 3'#0;
>    T4 : array(0..8] of char = 'Delphi 4'#0;
>    T5 : array(0..8] of char = 'Delphi 5'#0;
>    T6 : array(0..8] of char = 'Delphi 6'#0;
>    T7 : array(0..8] of char = 'Delphi 7'#0;
>    T8 : array(0..12] of char = 'CodeGear RAD'#0;
> begin
>    Result := True;
> {$ifndef ELREG}
>    H1 := FindWindow(A1, T1) + FindWindow(A1, T2) + FindWindow(A1, T3) + FindWindow(A1, T4) + FindWindow(A1, T5) +
>          FindWindow(A1, T6) + FindWindow(A1, T7) + FindWindow(A1, T8);
>    H2 := FindWindow(A2, nil);
>    H3 := FindWindow(A3, nil);
>    H4 := FindWindow(A4, nil);
>    Result := (H1 <> 0) and (H2 <> 0) and
>              (H3 <> 0) and (H4 <> 0);
> {$endif} {ELREG}
> end;
> 
> Thanks for any help you can give.
> Jimmy

you can add a command line parameter in the project settings.
then ifdef  checking for the parameter.

Jim P
0
Jim
8/23/2008 9:04:08 PM
Reply:

Similar Artilces:

VS ide / delphi ide key map
I'm quit lost in VS ide, F9 run, F8 / F7 Ctrl+Alt+P for tool pallet and the fast find when you type component name F11 to switch to code view / object inspector, the ability to navigate in the object inspector with tab and writing property name. Will someone make a Delphi to VS guide? -- Henning Swiboda wrote: > I'm quit lost in VS ide, F9 run, F8 / F7 > Ctrl+Alt+P for tool pallet and the fast find when you type component > name > F11 to switch to code view / object inspector, the ability to navigate > in the object inspector with tab and writing propert...

Comparison between Visual Studio 2008 IDE and Delphi 2010 IDE?
Hi, I wonder which is more programmer friendly. Especially for syntax highlighting and fast code writting, viewing.. Thanks.. Mehmet Fide wrote: > Hi, > > I wonder which is more programmer friendly. Especially for syntax > highlighting and fast code writting, viewing.. > > > Thanks.. See "RAD Studio 2010 vs. Visual Studio 2010" in non-technical group. -- Warm Regards, Lee ...

Delphi IDEs
Is it possible to write applications for Android and touch sensitive screens with Delphi XE4 or later versions of Delphi? Is it possible to write applications for Windows 8 and touch sensitive screens with Delphi XE4 and later versions of Delphi? Pier Pier wrote: > Is it possible to write applications for Android and touch sensitive > screens with Delphi XE4 or later versions of Delphi? iOS support was added in XE4. Android support was added in Delphi XE5. > Is it possible to write applications for Windows 8 and touch sensitive > screens with Delphi XE4 an...

IDE
Hi, we'd been using JBuilderX for 4+ years now and looking to re-tool but unfortunately, the latest version does not support EAServer. I'm curious what others are using for development. Are there any other IDEs that support deployment to EAserver as the older JBuilder used to do? Eclipse? Marley wrote: > Hi, we'd been using JBuilderX for 4+ years now and looking > to re-tool but unfortunately, the latest version does not > support EAServer. I'm curious what others are using for > development. Are there any other IDEs that support > deployment to EAs...

ide
hi all ! i'm using perl with tk extension in developping desktop apps . working on macosx platform, I use either the Xcode editor or emacs. i'm lacking debugger support and tk gui ide . anybody any idea if there's a ide out there with support for debugging and/or tk ? thanks erik --Apple-Mail-4-517507745 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Try ptkdb. You can get it from CPAN as Devel::ptkdb (I think; not where I can check at the moment). Then run your app as 'perl -dptkdb myapp'. On Jul...

IDE
Does anybody use an IDE or code (web coding: HTML/XML/CSS/JS/PHP/JSP) editor that they would recommend. I've been evaluating several and here are my results so far: NVU: I don't like WYSIWYG editors but I'll keep it around for the occasional complicated table I need to do quick. Scite: I haven't looked at it in depth but it didn't seem to have the project management I wanted. Screem: It was too buggy, the project management was too difficult, and it had no regex support that I could find. Bluefish: I'm using it now and it looks good but I've n...

IDE
How can I modify the IDE of PowerBilder? Thanks -- ________________________________ Alessandro Isola Ateikon s.r.l. Uff. Conegliano 0438/415709 www.ateikon.com What exactly are you trying to achieve? The IDE is highly customizable by itself, and if you really want to go deeper than that, there is a set of instructions to make even deeper modificaitons, although these are not for the faint of heart. regards, Bill Alessandro Isola wrote: > > How can I modify the IDE of PowerBilder? > > Thanks > > -- > ________________________________ &...

Delphi 2006 vs Delphi 2009 IDE stability
Hello, all. I have medium sized project which includes about 20Mb of source code (just size of *.pas files). I use Delphi 2006. There are third party component suites JVCL, DevExpress Bars, Pegasus Imaging. All updates applied. The main problem is IDE stability. About four..five times a day IDE become unstable after intensive usage of code insight functions (most often I press Ctrl+Space key). The best outcome is that I have to save everything and restart the IDE. The worst outcome is when IDE stalls or falls into endless loop of error messages and any unsaved work is lost. OS...

Re: Where is data form wizard in Delphi 2009? [pubic.delphi.ide]
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_21560.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Sample picture showing drag and drop from persistent fields edit window. (Any TField in any TDataset should work, TSomeKindofTable, or TSomeKindofQuery. Warren --JivePart=_21560.zeB8CwDOH5aMJzMl Content-Type: image/jpeg; name="drag_and_drop_from_persistent_fields_editor.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; ...

about IDE
 Hi,i am a C# coder, and now i want to start to learn asp.net . i started by Visual Web Developer ,but that is too much slow for my PC (1.73 GHz processor, 512Mb Ram). So, which IDE i can use  for best feature ?Please share to me with any opinion for getting start or anything else.... Thankx in advanceregardsarefin  Why not extend your RAM to 1G or higher for you to perform development faster? Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET Visual Web Developer is th...

Version nbr on TRAN-IDE, MSG-IDE
I've installed the EBF19641 on my client. I'd hoped to see the version nbr reflected on the "properties" window. But I don't see a new version nbr on TRAN-IDE (still see imc53). And I don't find a properties screen/window at all for MSG-IDE. Is the display missing? The version number is not updated on the Tran-IDE start up screen. When you install a patch, make sure you copy the Cover.ROLL.xxxxx file into the NNSY_ROOT directory. If you encounter a problem with Tran-IDE, then mention your current patch level specified by the number appended to t...

ides
begin 666 ides.zip M4$L#!!0````(`+**!B_QYF)N+ ,``$L&```,`!4`;&]V9V%T96PN:61E550) M``,0*S$_$"LQ/U5X! `D!"0$755;LF,K"/T_59D#0T!$T>'X@/D/H1<[Z7MR M^R_E%EDO2,0>M$T/G74VU;XK-3Z7_-BB<>>AJCBKL1>M63;I+4KJY[Q^^$XE M-U,:L9ULC$UMS8XS7(Q83&6R4HLF5*]W"A&AP95?/[%ZI[7+HF(QZ$0MZ/+W MC%=,.EX,356IRYDD"[^N1KQ^7/:FM;Q23'&*TG&;F>F*&K%716>T>F"W#C3B MI0`FHW,/`\X0(U%T*3."JM=)K>*BWX*W-,]""M! @B%XAL.?S@*M-CK7F\6C M"$D#FL8*":2CSEI>.84N2)-8DKHR45SJ1=TY5 HN+HA%;%; /CKTPX,N:]%6 MN8 ]&am...

Which IDE
This is not which IDE is the best post, it is a which IDE is best for ME post. Currently I am using Web Matrix but there are a few things that I don’t like. 1. Like every one else, no Intellisense (code completion) 2. I want tabs that show all my open documents which I can quickly flick through like Visual Studio. What I don’t like about Visual Studio .Net Professional: 1. The price. 2. I don’t like using code behind that much but I guess I’m just not used to it and can get over the fact. So this is not so major. The way I work now is assemblies and code in the aspx pages in ...

what is the best Delphi IDE
Hello, I am making a pool here tell us what is the best Delphi IDE you work with ? isaac sam wrote: > Hello, > I am making a pool here Cool! I'll take care of the drinks. FWIW, reservations made by getting up very early and putting a towel on a deckchair will not be honoured (I'm sure some of our European guests here will recognize the system). -- Rudy Velthuis (TeamB) http://www.teamb.com "What a cruel thing is war: to separate and destroy families and friends, and mar the purest joys and happiness God has granted us in this world; to fil...

Web resources about - IDE Only - embarcadero.delphi.ide

Pour Yourself a Stiff Drink, Here’s Your Open Thread for 2016’s First GOP Debate
Gather ‘round everyone, it’s the first Republican presidential debate of 2016! Taking place in Charleston, South Carolina, this debate — the ...

Twitter sued by U.S. widow for giving voice to Islamic State
Twitter Inc is being sued by the widow of an American killed in Jordan who accuses the social media company of giving a voice to Islamic State, ...

Anne Hathaway Pays Tribute to Alan Rickman
Anne Hathaway tries to keep her baby bump covered in a flowing grey jacket on Thursday (January 14) while out in Beverly Hills, Calif. The 33-year-old ...

Winners of $1.6 billion Powerball jackpot still officially unknown
By Victoria Cavaliere LOS ANGELES (Reuters) - Three ticket holders with a claim on a record $1.6 billion Powerball jackpot were laying low on ...

Everything You Need to Know About Obama’s Autonomous Car Plan
In his final State of the Union, President Obama hinted about building a “21st century transportation system.” Now we know he was actually sitting ...

Spotify is flying the company flag at half mast in memory of David Bowie
Spotify's office in San Francisco is flying its flag at half mast this week in memory of David Bowie. Bowie died after an 18-month battle with ...

Caitlyn Jenner Reacts to Ricky Gervais' Golden Globes Joke
Caitlyn Jenner smiles while on stage promoting the second season of her show I Am Cait during the 2016 Winter TCA Tour on Thursday (January 14) ...

First iOS 9.3 Beta Released To The Public
Over the past week, we have been hearing a lot about iOS 9.3 and what kind of features it will be bringing to the table. The good news is that ...

Skype preview adds Slack integration
Microsoft has introduced a new Skype preview version that includes Slack integration, enabling Slack users to make video calls and voice calls ...

You can forget about streaming US Netflix content abroad
The streaming service's catalog of TV shows and movies varies widely from country to country, but you're just going to have to deal with it. ...

Resources last updated: 1/15/2016 2:24:40 AM