Combine the flour, cornstarch, salt, and sugar in a 1-quart saucepan. Using a wire whisk, stir in the milk, add the chocolate, and bring the mixture to the boil, stirring, over low heat. Cook, stirring, until chocolate melts and filling thickens.
Combine the yolks with a little of the hot filling, then return this mixture to the filling. Continue to cook, stirring, over very low heat for 2 minutes more. Remove from the heat. Add the flavoring and butter and let cool slightly. Pour into the baked pie shell and serve cold with sweetened whipped cream on top.