As a software programmer, how can I close NJStar Communicator in my program?

On Windows 10/8/7/XP/Vista 32 bits.

SendMessage(FindWindow("NJCOM32",NULL),WM_CLOSE,0);

On Windows 10/8/7/XP/Vista 64 bits.

SendMessage(FindWindow("NJCOM32",NULL),WM_CLOSE,0); 
SendMessage(FindWindow("NJCOM64",NULL),WM_CLOSE,0);