c - How do I free the standard icons and cursors (those loaded with LoadIcon/Cursor(NULL, IDI/IDC_WHATEVER))? -
another quick question time: dll handles ui stuff has uninit()
function should called before program terminates frees resources (unregisters window classes, deletes private heap, etc.). required call unloading idi_application
, idc_arrow
, , other system icons , cursors loaded loadicon
/cursor(null, idi
/idc_whatever)
? closest can gather msdn deleteobject()
should not called on these icons; there no such function, in case? thanks.
you don't unload system-defined icons or cursors. documentation destroyicon, instance, says (emphasis added):
it necessary call destroyicon icons , cursors created following functions: createiconfromresourceex (if called without lr_shared flag), createiconindirect, , copyicon. do not use function destroy shared icon. shared icon valid long module loaded remains in memory. following functions obtain shared icon.
- loadicon
- loadimage (if use lr_shared flag)
- copyimage (if use lr_copyreturnorg flag , himage parameter shared icon)
- createiconfromresource
- createiconfromresourceex (if use lr_shared flag)
the above states icons obtain loadicon() should not destroyed. same said in documentation destroycursor:
destroys cursor , frees memory cursor occupied. do not use function destroy shared cursor.
Comments
Post a Comment