In a medium, heavy saucepan, whisk together the sugar, cornstarch, flour and salt.
Put a medium-high heat under the pan and whisk in the coconut milk and half-and-half, making sure there are no lumps. Whisk in the egg yolks.
Cook, whisking constantly, until the mixture thickens and reaches a boil. Keep it boiling for a minute or two (still whisking!). Remove from heat. Stir in the coconut flavoring, vanilla and butter.
Pour the custard into a bowl and press plastic wrap onto the surface. Chill until at least room temperature, preferably cooler.
A few hours before you want to serve the pie, whip the cream with the powdered sugar in a chilled bowl until stiff. Spoon the custard into the piecrust, and top it with the whipped cream and a sprinkling of toasted coconut.