If you are using Visual Studio, you can take a look at StyleManager *. This is a VS add-in that simplifies customization of formatting styles and applies them to the code whenever you need. This is a popular choice for VS users, and in particular, the DirectX SDK development team used their sample code.
* Huge disclaimer: I am one of the authors of this software, so I apologize for the shameless version!
source share