Forget the word PC and things might make a little more sense.
From what I'm understanding, you want to take the motherboard and cpu, ram and drives from your existing HP case, swap them both to a new case and add a rtx2060.
That changes nothing but the case. Your 'build' or PC hasn't changed, everything is still the same, so Windows licensing doesn't apply, no need to worry about anything whatsoever except 2 things. The new case front connectors and the psu.
Aftermarket cases are universal. HP is generally proprietary, just like Dell or Lenovo or Sony etc. So the front connectors for hdd led, power button etc may be setup/pinned for the original case and there may be issues with that swap.
Same applies to the psu. Different motherboards have different requirements. Many proprietary motherboards used by Lenovo or Dell especially have a non traditional 14 pin main power connection with 4 or 6 pin subsidiary connectors. The traditional aftermarket main power is 20+4 pin, so there may be a need to obtain adapters.
And that can go both ways, since your original case psu will have the correct matching connection, a 500w psu with a 350w need on that gtx745, vrs a now limited 500w psu with the needs of the rtx2060 at 500w, which it may not be enough, requiring a better, stronger psu that'll have aftermarket 20+4pin mains connection.
Swapping cases with Proprietary pre-built parts is never an easy task, and very rarely is a direct swap with no issues. It can be done, just plan on hiccups along the way.