You can use the control IN transfer and A0 vendor command to check if the bootloader is running.
Do a control IN Transfer with:
length = 1.
reqCode = 0xA0;
If the transfer is success then the bootloader is running else no.
Please refer to the below code where the mentioned method is used in Windows Cpp using CyAPI.lib
Worked exactly as expected thanks!