I’m working on a little test application at the minute and I have multiple window objects floating around and they each call RegisterWindowEx with the same WNDCLASSEX structure (mainly because they are all an instance of the same class).
The first one registers ok, then multiple ones fail, saying class already registered – as expected.
My question is – is this bad? I was thinking of using a hash table to store the ATOM results in, to look up before calling RegisterWindow, but it seems Windows does this already?
You can test if the window class was previously registered calling GetClassInfoEx.
http://msdn.microsoft.com/en-us/library/ms633579(VS.85).aspx
This way you can conditionally register the window class based on the return of GetClassInfoEx.