I was recently taking a critical look at some of the basic Win32 classes that I have in Hieroglyph 3, and I want to move to a more proper implementation of my Win32RenderWindow class. Basically the class manages an HWND, handles the initialization (window class registration + window creation) and shutdown, and then map the useful Win32 API calls around the managed HWND. None of this is very special, and I'm sure most games / engines have similar code there.
While looking around for some good examples of RAII based management of an HWND, I found this gem of a post: Simple Main Window Class. The code in the post is of quite good quality, and sheds light on some of the dark corners of handling Win32 windows. However, I have a question about something I saw in there... The author goes to great lengths to generate a unique window class name for each instance of the Window class. This is done with some template meta programming to append a value to the end of a string, and it seems to work fine in practice (he even ensures that it works for different platforms - both x86 and x64 work correctly). So whenever multiple windows are created, they each have their own unique window class to use.
In Hieroglyph 3, I simply register the window class once during the initialization of each window. This hasn't ever given me any troubles, since all of the windows use the same Window Procedure function to handle messages (it basically just looks up a pointer to a handler object and forwards the message call). After about 30 minutes looking through the Win32 documentation, I haven't seen anything that indicates that registering the same class multiple times causes any harm. In addition, the docs say that all of a process's window classes are automatically deregistered when the process ends.
So finally the question: is it worth it to add a complex method of generating unique window class names? It seems like a major complication to something that could potentially be very simple - but if there is a good motivating factor behind it, then of course I can go down a similar path. Any advice from the windows experts out there? What do you guys do???