Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/articles/cpp-tutorials/)
-   -   Syntax highlighting for User-Defined Keywords (http://www.go4expert.com/articles/syntax-highlighting-user-defined-t1509/)

shabbir 1Oct2006 06:18

Syntax highlighting for User-Defined Keywords
1 Attachment(s)
You can add words to be highlighted in the IDE of Visual Studio 6, 2003 and 2005.

Steps (From MSDN)

  1. In the same directory as msdev.exe (for Visual Studio .Net search for ...\Microsoft Visual Studio.NET\Common7\IDE\devenv.exe), use the Text editor or Windows Notepad to create a text-only file named usertype.dat.
  2. Add your keywords to usertype.dat, one keyword per line. Note: The usertype.dat file is read during initialization. It cannot be renamed, nor can it be reloaded during an editing session. The syntax coloring mechanism checks the usertype.dat file last. Thus, all previously defined color settings take precedence over the user-defined keywords.
  3. Save the file as a text-only file, exit, and then restart Visual Studio.
  4. From the Tools menu, choose Options.
  5. Select the Format tab.
  6. In the Colors box, select User Defined Keywords.
  7. Set the font, font size, foreground color, and background color to your preferences.
  8. Click OK.
  9. Restart DevStudio.


Syntax coloring for user-defined keywords is used for C++ project files only like cxx and .h files.


With Large no of Macros and Windows function that you use in MFC its good to put them all in the file and set a different colour for them. This helps in writing the program and know what are the MFC/SDK function you are using.

I have added all the Windows message MACROS in the usertype.dat file attahced with the article. You can download the file and when ever you use any API or SDK function you can update it to make it complete.

aisha.ansari84 5Mar2008 18:50

Re: Syntax highlighting for User-Defined Keywords
got the thing

rahul.mca2001 6Mar2008 13:18

Re: Syntax highlighting for User-Defined Keywords
got it

All times are GMT +5.5. The time now is 21:00.