1. SendMessage only accepts one parameter eg ChatWnd.SendMessage
; or ChatWnd.SendMessage("Stuff"+h);
2. var h = hey; is wrong var h = "hey"; is right. Strings need to be in quotes
3. OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,Type)
4. Yes you can use C/C++ style equality checking.