hmm...
have you checked is there a windows api for this?