Hello evgyeufuygce
Theres no way I could answer that. If you have the tower in your possession, you will need to measure the area inside. Then go online and get the specs of what ever specific GTX 1050 you are going to purchase. It will tell you its specific dimensions. Different mfg's have different specs.
You may have another problem though. Windows 7 SP1 will work with the 1000 series of video cards. But of the HP Pro 3010 Microtowers I looked up, the hasn't been a bios update since early 2010. That will be the factor that stops the GTX 1050 from working in your PC.
So even though you may find one that will fit, it probably wont work due to the bios limitation.