Hi:
There should be no trick to get the wifi to work.
The PC should automatically be detecting that wireless networks are available.
Since you are not the original owner of the PC and it is 8 years old, I recommend you open it up and ensure the Ralink wifi adapter is present on the motherboard and the required antenna cable(s) is/are connected to it.
If the card is present, then it has suffered a hardware failure, which was a fairly common occurrence with that model wifi adapter.
The easiest thing to do to add wifi capability to your PC, would be to purchase an external USB wifi adapter.
Here is the link to the service manual...
http://h10032.www1.hp.com/ctg/Manual/c03359399