File extension associations are stored in the registry. Writing this information involves knowing a bit about how applications are created and maintained in the registry. Fortunately, there's a simple article here on Code Project that contains a project that simplifies the access to an almost insane degree.
Link[
^]