Okay, serious dilemma. I am trying to wrap the Windows API. and the biggest design problem I’ve run into (for now) is what class is suitable for wrapping what? Since I’ve created a Windows API wrapper about three times before, always running into a design issue in the middle of things, this time, I intend to tread carefully, asking the confusing parts over here before implementing them.
Should the WNDCLASS and the main windows created by CreateWindow be wrapped in a single class or separate classes? Should I create a singleton to hold the WNDCLASS?
Also, if anyone can give me a flow-chart or general idea, on how to abstract the Windows API into classes, some good design tips?
For a good source of inspiration, look at the .Net framework – there is no concept of WNDCLASS! You could have your library create a WNDCLASS that is shared by all your windows. You don’t need singletons (uurrgghhh) since the class can be used by a string. If you want to change some of the characteristics that WNDCLASS defines for a particular window, I think you can use the SetWindowLongPtr function.
Things to consider: