how to run code by start addin

Hi all

     I want to write a code to  auto run when i startup a specified add-in ,such as inspection add in . do you how to use sw API event.

SolidworksApi macros