We have investigated the role of the Antennapedia and Bithorax complexes (ANT-C and BX-C) on the production of cuticular hydrocarbons in Drosophila melanogaster. In males, there is little, if any, influence of these complexes on the hydrocarbon pattern. In females, there are large and opposite effects of these complexes on diene production: two ANT-C mutations cause an increase in diene production and a reduction of monoenes, whereas most BX-C mutations result in a decrease in dienes and an increase in monoenes, although their sum remains constant. The effect is the highest in Mcp and iab6 females. It is suggested that a factor originating from the prothorax might activate the conversion of monoenes to dienes in females. The abdomen seems to have a crucial role in the production or control of pheromones: abdominal segments four to seven have the main effects, with a most dramatic effect for segments four and five.