how to write solidworks event for PMpage

Hi

    I have written a solidworks add-in, but i don't know  how to write a code to judge whether to close the window and send a message"you must choose face" when the user choose nothing and click the right button.

SolidworksApi macros