How do you get a handle on the X button in the title bar to send to tray instead of closing? I have the code to send to tray but no matter what I try the X still ends the program. Is this an API?