Im writing a virus checker type program and i need to know when any file has been opened in windows.

I'm guessing this would be an API call to find this out, probably using some kind of hook procedure.