I am experiencing something very weird on my Compaq Presario 720US which is running Windows XP Home with SP2. The firmware is current (version F0.C). My problem: at random intervals, something takes control of my cursor and sends it to the upper right-hand corner of the display, whereupon it does a series of left and/or right button clicks. If your current window frame is maximized then that frame gets closed - terribly inconvenient as you might imagine.
You have spyware or malware of some description on your PC, by the sound of it. You should follow the advice given in the "Helping Yourself" topic in the security section, and then report if you still have problems after using the suggested tools.
I'll move this topic there, because your problem is definitely not a hardware one ;)