I was just wondering if anyone could help me with the following question: How a window in the WIN32 API could be related to OO concepts.
If you think that a window is not OO, that doesnt matter. I just need ideas how it can compare with OO. This is for a possible exam question that could occur.
However, I have only been only been able to come up with the following relations shown below. If anyone could extend any of these that would be great, or provide any details that you think I have missed.
Class - A window exposes properties and methods that can be set and retrieved by the programmer. E.g. the name of the window (lpszClassName) and the icon associated with the window (hIcon). Could be viewed as a class, however the properties are all public by default. Has WM_CREATE and WM_DESTROY messages, which could be viewed as very basic constructor and deconstructor calls.
Inheritance - It is possible to inherit characteristics of other windows, but I am not sure as to how this takes place. Is this managed through the hWndParent parameter when you create the window?
Polymorphism - In order for the window to respond to messages, the user must provide a basic message pump using a call-back method. As the implementation is not fixed, this could be related to polymorphism.
Events - Windows messages could be contrasted to events that are exposed by components or objects.
Thanks in advance for any advice.