Search DFM File using Delphi IDE

Is there a way within the Delphi to search within the dfm files for a string?

When I try the Search->Find in Files specifying .dfm it does not work. However, if I change all the extensions from dfm to txt and specify .txt as the extension it works.

-------------Problems Reply------------

I'm using the GExperts grep and it works very well with dfm when you check "Search Form Files"

Search DFM File using Delphi IDE

Update: why I prefer GExperts to D2010 "Find In Files"...

  • I work with D2007 as well as D2010. I can use the same search tool consistently in both.
  • You can limit your search to Open/All-in-project/All-in-project-group and still get the dfm, while in D2010 you get the dfm only for directories and it does not even work in D2007.
  • I can use both if I want.

There is any easy way to work with DFM files.

  • Open the form so you can see it visually.
  • Right-click and select 'View as Text'.
  • Treat the resulting text file as source code, play with strings etc, then when you're done, right-click and select 'View as Form'.

    Try it.

Ok... Not sure if you meant for a way to search from Delphi's IDE or from Windows. From Delphi's IDE, like François mentionned, GExpert's GREP search does the job. To allow Windows to read DFM/PAS files, you need to add a few registry key to allow it on Windows XP and later. Save the following content in a *.reg file and double-click on it to install in registry. (Note, that works in WinXP. I didn't try it in Win7/Vista)

Some of those keys might not be required... I just copied stuff from the [HKEY_CLASSES_ROOT\.txt] key. ^_^

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.dfm]
"PerceivedType"="text"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\.dfm\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.pas]
"PerceivedType"="text"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\.pas\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

Category:delphi Views:1 Time:2010-05-20
Tags: delphi

Related post

  • A quick way to remove properties from .dfm files in Delphi 2012-03-02

    I have recently modified one of my components, and it so happens it is no longer using one of the properties it used before. However, those properties are written in multiple .dfm files throughout the project. Now, when i try to compile the project,

  • Cannot open .dfm files in IDE 2011-01-13

    My system configurations are a follows Delphi2010 on windows 7 professional. I have a problem with some of .dfm files in the project. I got it as follows. First of all I needed to change some datatypes of TOraQuery component fields from TStringField

  • Exist a tool to convert DFM files to sourcecode? 2010-03-03

    I'm porting a app to FreePasal/Lazarus & found that their form converter is not good. I have a small utility app, and each time I do a change I need to reconvert, relayout and reimport graphics. Plus, some things are messed up. I wonder if exist

  • Delphi 7 RLINK32 Error reading dfm file - failed read 2010-12-03

    I just run into a problem that came out of nowhere... A DFM file gets read just fine from Delphi when project is built, but when I build it from command line (dcc32) I get error Error: RLINK32: Error reading file "update.dfm" Failed read What is more

  • How do you do a global search and replace in all the files in Delphi 2006 project 2008-11-03

    Help !!! I have just spent about 10 minutes looking for a way to do a search and replace over all the files in Delphi 2006 project. Please can you tell how to do it --------------Solutions------------- I would use Grep Search from GExperts for this A

  • search and replace inside files usind Delphi language 2009-12-19

    I want to make a small app with Delphi to search inside files for a specific word and change it then save the file It should support ansi and utf-8, how I should do that ? thanks --------------Solutions------------- If this is Delphi 2007 or older, y

  • How to search and replace a tag value in xml file using delphi? 2010-01-19

    How to search and replace a tag value in XML file using Delphi? I know what the XML tag is, but the value is random and simply needs to be reset to a default value, so in reality I cannot/should not search for the value but only the tag. I also know

  • Fast Search to see if a String Exists in Large Files with Delphi 2011-02-16

    I have a FindFile routine in my program which will list files, but if the "Containing Text" field is filled in, then it should only list files containing that text. If the "Containing Text" field is entered, then I search each file found for the text

  • Delphi IDE changing imagelist in inherited DFM files 2011-03-15

    When opening a form which contains an inherited TImageList in Delphi (2010 in this case, but it may do it for other versions), the IDE invariably (I can't find any rhyme or rhythm to it) adds the image data again to the inherited form. This then incr

  • How to remove duplicate resources (RES, DFM) while using Delphi with non specific Library paths? 2010-09-16

    I followed the advice received in a previous discussion ( http://stackoverflow.com/questions/3666292/should-library-path-point-to-the-source-files-of-packages/3686542#3686542 ) and now my Library Path points to folders containing the compiled code (D

  • Downloading a file in Delphi 2010-08-17

    A google search shows a few examples on how to download a file in Delphi but most are buggy and half of the time don't work in my experience. I'm looking for a simple robust solution which will let me download a single exe (for updating my app) and w

  • Read and play Wav file in delphi 2014-11-09

    How can I play uncompressed wav files in delphi? I mean reading the wav file byte by byte and sending the data directly to the speaker. I have searched the internet and found some functions for playing sound for a specified period of time. for exampl

  • How do you search for files containing dos line endings (CRLF) with grep on Linux? 2008-09-16

    I want to search for files containing dos line endings with grep on Linux. Something like this: grep -IUr --color '\r\n' . The above seems to match for literal rn which is not what is desired. The output of this will be piped through xargs into todos

  • What is the best or cheapest library for creating PDF files in Delphi? 2008-09-20

    As the title states: What is the best or cheapest library for creating PDF files in Delphi? --------------Solutions------------- Best OR cheapest. These hardly ever combine well. "Give me you biggest, strongest, cheapest drink." -Bender Bending Rodri

  • How to use 'find' to search for files created on a specific date? 2008-10-01

    How do I use the UNIX tool 'find' to search for files created on a specific date? --------------Solutions------------- As pointed out by Max, you can't, but checking files modified or accessed is not all that hard. I wrote a tutorial about this, as l

  • Is there an Open-Source Web Search Library that does not use a Search Index File? 2008-11-07

    I'm looking for an open-source web search library that does not use a search index file. Do you know any? Thanks, Kenneth --------------Solutions------------- You mean: search.cgi #/bin/sh arg=`echo $QUERY | sed -e 's/^s=//' -e 's/&.*$//'` cd /va

  • How to search Jar files using Windows Search? 2009-05-18

    I believe back when we were on Win2K, Windows Search would search through Jar files to locate specific classes but this doesn't appear to work in XP. Does anyone know how to enable this in XP? Note, to do the search in Win2K we just entered *.jar for

  • Upload file using Delphi CGI 2009-05-31

    Could anyone please give a working example of how to upload a file using Delphi CGI. I have googled but so far haven't had any luck. This is what I have been trying but I am getting access violations. procedure TWebModule1.WebModule1WebActionItem1Act

  • how to search the file in the next level of the mac root? 2009-07-28

    I want to search a file and get it in the mac root . I used the subpathsAtPath: of NSFileManager and put the root path "/", but I found that this func searched so deeply and took a long time. I hand known that that the file I want to find in the the

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.098 (s). 11 q(s)