Harry,
The VFP application class in the framework is an example, as is the application object in CodeBook. Ther is also an example in Steve Sawyer and my book "Effective Techniques" as well as many other books. The whole story is a little too much for a forum message though.