Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Talib

RegisterClass - Just for interest sake?

This topic is 5290 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Can someone please tell me what registerclass() actually does? Some more detail than the help files would be appreciated. IE Why is it necessary, what happens when you do register a class. I really would like to know more, just for interest sake. Thanks Talib

Share this post


Link to post
Share on other sites
Advertisement
To my knowledge:

When u want to create a window in Windows u have to tell Windows how you want to look and perform. So what you do is set the attributes of this class and then register it with windows so that u can use the CreateWindow function. Notice in the CreateWindow function u have "Registered Class name" which is the same as one of the parameters in the WINDOWCLASS/EX class.

SDK definition:

"The RegisterClassEx function registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function. "

regards

ace

Share this post


Link to post
Share on other sites
The general idea is that you set up a general type (or class) of window and then use this window type multiply times.

The idea being I think, that less memory is used per window instance as data can be shared between types. This was quite a concern under 16bit windows. Also, it allows others to use classes you define simply by using their name in the CreateWindow call. The window should work without the user having to know about how it was created, thus common controls can easily be defined.

Windows was designed as an object based API. A lot of object paradyms (sorry, weasel words) are present in the Win32 API. Of course, that doesn''t stop it being a right bitch to use.

Hope that helps.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!