There is more simple way to do it dirrectly in VFP-toolbar or object oriented menu.
I used add method of the VFP _screen object, adding simple command buttons.
The buttons were prepared in advance in library and had nessacery codes.
It was only one tric , how to release this object. I did also some custom class with method release-for example release _screen.newbutton.
Exit button of the toolbar has code oapp.tool.release.
I also used standard toobar class without forms sets.
In oapp object I wrote set classlib to myclass tool=createobject('mytool').
Mytool class was based on standard VFP tool class. Exit button has also code oap.release , oap.release has code release tool
MVP-2006-2011, PHD in Math and Physics ,
host of
www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.