Once you have defaulted on your mortgage or have gone into foreclosure all your rights on the homeowners policy are null and void. all rights of recovery revert to the Mortgage company.
Basically you become uninsured and the mortgage company remains insured through the policy term.
Also if the policy gets cancelled due to the foreclosure any refunds belong to the mortgage company.