Since all apps on your iPhone should be in your iTunes library, this would not happen if you transferred your iTunes library from your computer's backup to your reformatted computer's hard drive per the instructions included with this link. Since this is a regular/common occurrence with Windoze - reformatting your computer's hard drive and/or reinstalling Windoze, you may want to begin following these instructions for maintaining your iTunes library with your computer's backup or for creating a backup for your iTunes library before the next time you reformat your computer's hard drive and/or re-install Windoze.
http://support.apple.com/kb/HT1751
Following the instructions for backing up your iTunes library and restoring from the backup will prevent your iPhone from being erased of all iTunes content with the first sync with iTunes on your reformatted hard drive.
If all apps on your iPhone are not in your iTunes library, with your iPhone connected at the iTunes menu bar go to File and select Transfer Purchases From - the name of your iPhone.
Follow this by creating or updating your iPhone's backup. Right-click on your iPhone under Devices in the iTunes source list and at the menu window that appears, select Back Up. Follow this by restoring your iPhone with iTunes from your iPhone's backup and then re-transfer all apps from your iTunes library to your iPhone with the sync after doing so.