OEM windows is "married" (tattoed) to the OEM motherboard. If you change the motherboard to other than a direct OEM replacement from HP, you have to buy a new copy of windows. All of your other equipment will work with the new m/b, including your old harddrive, except you will have to perform a clean install of your new copy before any of your system components will be recognized.
If you have a secondary hdd, backup your data and any other important info to that, then remove the old m/b, put in the new, connect ONLY the hdd you wish to install the new windows on and the dvd drive, boot to dvd and instruct windows to format and install the drive.
This "tattoo" is standard on all OEM pc's, not just HP.