In HTC S740 manual there is procedure for hard reset that uses program called Clear Storage in order to reinitialize phone. That will not help you if you forgot password or your phone cannot boot.
In order to perform real hard reset on this device, you need to connect your phone to power (via mini-USB cable) and turn it off. Once it is off, press D-Pad Center key together with Volume Down key. While holding those two, shortly press power button. You should get white screen with instructions. You can release those two keys and press Volume Up if you are sure that complete deletion is fine with you. Any other key will cancel process and continue with boot.
Please notice that if you complete procedure ALL your data stored on mobile phone is gone and there is no way to get it back.
[2009-06-30: FAQ entry was added on HTC support site with this procedure described.]