ResRenum renumbers resource IDs in Visual Studio C++ projects. I wrote the first version of this app in 2001 and I've been using it regularly ever since. For years I've wished it could also remove unused resource IDs, and I finally got around to implementing that recently. That gave me an excuse to release it, so here it is.
ResRenum is a console app, and it's intended to be integrated into the IDE as an external tool. It's compatible with any version of Visual Studio from MFC 6.0 onwards. It's been tested in 6.0, VS2008, VS2010, and VS2012.
The resources are sorted in alphabetical order within each resource type. The resource types are sorted in compliance with Windows rules. Unicode is fully supported: the app automatically detects if either input file contains Unicode text and does the right thing.
ResRenum takes two arguments: the path to the resource header (usually resource.h), and the path to the resource file (.rc). The second argument is optional, but if it's specified, ResRenum deletes unused identifiers from the resource header. This is usually what you want.
Note that this method only works if your resource IDs adhere to the Microsoft conventions, e.g. dialog IDs should start with IDD and so forth, see TN020 ID Naming and Numbering Conventions.
Also note that in some cases Microsoft puts defines in resource.h for which there's no corresponding resource. For example the default dialog app uses resource.h to define the the system menu command IDM_ABOUT. If you use ResRenum to delete unused identifiers, IDM_ABOUT will become undefined, and your resource file won't load. The solution is to define IDM_ABOUT somewhere else, e.g. in the dialog header, as in:
enum { IDM_ABOUT = 0x0010 };