If the question is closed as off-topic (or due to some other reason) then I think it does not makes sense to enable up or down vote for that question.
All of the reasons for closing quotes are subjective. What you may deem off topic, I may think entirely appropriate, and vice versa. This is why it takes five like-minded people (or one moderator) to close a question for any reason.
Similarly, posts can be reopened with five votes. A vote represents an opinion, not an edict. The system allows for individual imperfection.
Except for moderators, of course. Mods are, by definition, perfect in their judgments. Yet even five reopen votes will overrule their close votes.
Why would you want to disallow an upvote on a closed question, particularly if you're concerned about discouraging an O.P.? I would think an upvote would be encouraging.
I've upvoted closed questions before, even when I've agreed they should be closed.
How can that be?
Questions are upvoted when they are clear, and show much research effort. (If you don't believe me, hover over the upvote button, and read what it says).
Questions are closed when they are duplicates, or off-topic.
It's entirely possible for someone to put a lot of research effort into a question, and to state it in a very clear an interesting way. That said, the question might still be off-topic.
P.S. I realize this is the exception, not the norm – I just wanted to give another viewpoint. All in all, I agree with the sentiments given at the MSO posting: if you don't want the downvotes, ask good questions.