Finding a DFM File Using the Delphi IDE

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

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

+6
delphi
source share
3 answers

I use GExperts grep and it works very well with dfm when you check "Search Form Files"

alt text
(source: gexperts.org )

Update: why do I prefer GExperts D2010 "Search in files" ...

  • I work with D2007 as well as D2010 . I can use the same search tool tool sequentially in both cases.
  • You can limit your search to Open / All-in-project / All-in-project-group and still get dfm , while in D2010 you get DFM for directories only, and it doesn't even work in D2007.
  • I can use both if I want.
+17
source share

There is an easy way to work with DFM files.

  • Open the form so that you can see it. visually.
  • Right-click and select View As Text.
  • Treat the resulting text file as source code, play from a string, etc., then when you are finished, right-click and select "View as Form".

    Give it a try.

+3
source share

Good ... Not sure if you wanted to find a way to search from the Delphi IDE or from Windows. From the Delphi IDE, as François mentioned, finding GEXpert GREP does the job. In order for Windows to read DFM / PAS files, you need to add several registry keys to enable them in Windows XP and later. Save the following content in a * .reg file and double-click it to install it in the registry. (Note that this works in WinXP. I have not tried it in Win7 / Vista)

Some of these keys may not be required ... I just copied the material from the key [HKEY_CLASSES_ROOT\.txt] . ^ _ ^

 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}" 
+2
source share

All Articles