I don't have a 40D ... I have a 30D and 5D.
Whenever I manage to get 'lost' inside the camera I do a Camera RESET.
( Never had these problems with my film cameras! )
The total reset will take you back to 'out of the box' configuration.
Be WARNED though it will RESET ALL SETTING you may have entered.
I actually do a RESET regularly in case I did something unusual the day before.