Background macro

I am still new with API. Is there a way to run a macro in the background while working on the application?

SolidworksApi macros