If you have a aftermarket alarm system, you maybe already capable of those functions.
On mine, I have the front & rear courtesy lights come on when I unarm/unlock the car...great feature for at night.
I also have aux1 & aux2 available to me, both can be programmed for pulse/latch & 1-99 seconds. So here, I can connect one to all the windows & the other to the sunroof.
Have another to even open the trunk if I wanted to.