In case the PC starts up but doesn't boot Windows, burn a disk with the appropriate version of Windows from the link above. Check your system, right-click on Computer and that will indicate which version of Windows 7 you have (32 or 64 bit, Home Premium or something else). Most likely you'll need 64 bit Home Premium. DO this before you change the mobo/cpu and if you need to, boot the PC from the DVD.
Start the PC with the DVD in the drive, usually HP uses F9 to get to a boot menu. Press F9 repeatedly until it gives you a choice of boot devices and choose the DVD. Follow the screens, format the hard drive and install a fresh copy of Windows. When the installation is complete, run the install disk that came with the new motherboard to install the needed drivers. Use the key on the sticker to activate Windows (activation status appears in the System Properties window when you right-click Computer and go to Properties)
You will lose all data and programs on the drive when you format. You can use an external HDD to back up any files you don't want to lose, and re-install your programs.