So you want to create a mini-spyware program.

Flash won't do it, PHP won't do it.

I don't think anybody's going to help you here. But if you're persistent, try making an ActiveX control.