I'm using properties quite a lot to avoid global storage. So far I'm not using Atoms, all properties are dwords of one sort or another. It struck me that Enumprop would be a tidy way to remove all properties from a dialog, having the Propenumproc call Removeprop for each property. This would certainly make program development & maintenance easier, but in my hands it certainly doesn't work. Looking at the WIn32 Programmer's reference for RemoveProp, I find:
Is there some way in which Emumprops/RemoveProp can be "tamed" to just remove all of the properties which I have added to the window? Then this can be called in the WM_DESTROY handler and everytrhing will be sweet.
I suppose one (nasty) way of doing it would be to use a macro or function to call SetProp which also stuck the property identifier and hwnd into an array declared static, with the array address passed via a property itself.
Is there a better way?
An application must free the data handles associated with entries removed from a property list. The application can remove only those properties it has added. It must not remove properties added by other applications or by Windows itself.
I suppose one (nasty) way of doing it would be to use a macro or function to call SetProp which also stuck the property identifier and hwnd into an array declared static, with the array address passed via a property itself.
Is there a better way?
Comment