Look into the PostMessage API, that's what I'd use