Set the tamessage and target in AttachedToWindow. Also, set when in message