You now should have a shortcut that opens your XPCE-program but it has two windows. The toplevel window is in minimized state and the 2nd window should be visible. When closing the visible window also the toplevel gets closed.
I did have a simpler way to run from shortcut. The pce_main_loop/1 was called inside the your_module.pl, but many Swipl.exe-versions ago the toplevel window stopped closing with the XPCE-program window. I don't remember what version started this behaviour.
I have 7.5.13 version of Swi-Prolog. The xpce_threaded-flag makes no difference. I haven't tried the qsave_program/1 stuff. I hope this helps those who likes to have their hobby stuff to start from shortcut :) Thanks.