Nope, sorry. That HP PC only fits a micro ATX motherboard (mATX). Your ASROCK board is a full sized motherboard. Even if it would fit, I wouldn't put a newer i5 chipset with the cheap PSUs that HP use in their consumer grade OEM builds...especially one that is already probably 6+ years old. You would be asking for frying your CPU/motherboard.