Changed CopyImage to accept desiredX, desiredY and LR_COPYFROMRESOURCE. CURSORICON_FindBestIcon changed to find the correct icon. ImageList_ReplaceIcon now calls CopyImage internally. Assign a value for the hIconSm CLASS member (using CopyImage).