How to get a control custom resource data
You can get common controls custom resource data ( see controlData section: http://msdn.microsoft.com/en-us/library/aa380902(v=VS.85).aspx ) by handling WM_CREATE and accesing lpCreateParams member of CREATESTRUCT. Is there any way to 开发者_StackOverflow中文版access the data after a control was created?
Looks like I found the answer. We can use FindResource->LoadResource->LockResource functions to get pointer to the dialog resource data. The pointer returned by LockResource will point to DLGTEMPLATEEX structure. This will allow to iterate through dialog controls to find the needed dialog item ( DLGITEMTEMPLATEEX ) and extract custom resource data from it
lpCreateParams is just a pointer to the additional creation parameters, as supplied by the caller. Its not the data itself.
The creator of the window/control would not make any guarantees to keep that data around after creation.
So, no.
精彩评论