How do pro-forms get their meaning? For example, does the word 'he' in the sentences "Harry got a toy. He was happy." get it's meaning from the context, or what the speaker meant by "he".
easy-peasy: context. what you meant is completely irrelevant once you utter your sentence. you could have meant -in your mind - anybody when you said "he". since your interlocutor cannot read your mind, all she has to go on is context - which includes conventions like "he" refers to the most recent "thing" mentioned to which "he" could reasonably apply.
Edited per comment from @user6726: touche! proforms do not "get" or "have" a "meaning". But they do have significance, or if you prefer a functional role. strictly speaking they do not "get" their significance from "context", either - they get it from the norms of linguistic practice, which in turn always involve an interaction with the context.
One can't answer the question without knowing the intonation of the spoken form. If we know only the written form, we just have to guess how it would be said. Using numbers to indicate pitch and stress in the fashion of SPE, with 1 highest, 2 next highest, and so on, and unmarked meaning lowest pitch and stress, my first reactions to the following examples are given below.
A. "2Harry 3got a 1toy. 2He was 1happy." B. "2Harry 3got a 1toy. He was 1happy." C. "2Harry 3got a 1toy. 1He was happy."
For A., the two sentences do not make a coherent discourse, and "he" refers to some other person. In B., "he" refers back to Harry. C. has contrastive stress, and "he" refers back to Harry, but the implication is that although Harry was happy, he was the only one, and others concerned who did not get toys were not happy.
D. "2Harry 3got a 1toy. The silly little boy was 1happy."
There is no pronoun in D, but the low pitch and stress of "the silly little boy" tells us that it is (what has been called) a pseudo-pronoun, and refers back to Harry, as in example B.