I won first place in the writing contest.

- I'm so happy for you.
(In this dialogue, what is the meaning of 'for'? What else can we use instead of 'for'?)

3 answers

I don't know of anything that could substitute for 'for' here. It's something of an idiom, meaning, 'Congratulations.'
Is it "I'm so happy because of you."
That has a completely different meaning.

"I'm happy for you" is sending congratulations and happiness TO the "you."

"I'm happy because of you" focuses the happiness on the "I" --which is the opposite of what you posted first.