Pruning is indeed good for these plants – especially for cucumbers. Let it build a strong main shoot but cut back the side shoots to about three leaves. The flowers, and later on the fruit, will be produced at their axilla. The fruit quality will increase that way. You can treat squash plants the same way – mainly on marrow sorts. Ornamental pumpkins, which need to be smaller anyway, can be left alone, more or less. This way they can grow a few more fruits. The squash types which should carry large fruits need to be pruned as described above so that you have less but better quality fruit.