-
November 30th, 2012, 02:01 PM
#1
Gwlp_userdata
I have to call GetWindowLongPtr() with GWLP_USERDATA to redraw my tabcontrols.
"Retrieves the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero."
What exactly is "user data associated with the window" ?
-
November 30th, 2012, 08:19 PM
#2
Re: Gwlp_userdata
Originally Posted by MasterDucky
What exactly is "user data associated with the window" ?
It is exactly as you stated -- it is user data that is associated with a window.
Say I wanted to have an some information to tag along with a window that is created. You would place that information into the GWLP_USERDATA section of the window object with SetWindowLongPtr() -- to retrieve the info you call GetWindowLongPtr().
So GetWindowLongPtr() doesn't draw anything -- all it does is retrieve the information that was saved in the window object by whomever. So I don't know what that has to do with redrawing tab controls, unless the information needed to redraw the controls was saved there, you need to retrieve it, and do something else with this info that has to do with redrawing controls.
Regards,
Paul McKenzie
-
December 1st, 2012, 07:23 AM
#3
Re: Gwlp_userdata
Thank you Paul,
So userdata means what is typed in the window for example or the coordinates of the window?
Regards
-
December 1st, 2012, 12:36 PM
#4
Re: Gwlp_userdata
Originally Posted by MasterDucky
Thank you Paul,
So userdata means what is typed in the window for example or the coordinates of the window?
Regards
Possibly. Maybe what's stored there is a pointer to further information. Programmers routinely use this area to store a C++ object pointer so that they can associate a C++ object with a window. When the window's handler is called, to retrieve the object pointer, they just go to that area.
Regards,
Paul McKenzie
-
December 2nd, 2012, 08:40 AM
#5
Re: Gwlp_userdata
Originally Posted by MasterDucky
So userdata means what is typed in the window for example or the coordinates of the window?
Userdata here means any data that programmer wants to attach to this tab. This may be a pointer to byte array, or string object, or predefined user structure instance, or user class object, whatever you want this to be. You may think of it like a locker where you put your valuable things (data) and leave those there until you need to reach to.
Best regards,
Igor
-
December 2nd, 2012, 09:30 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|