I've written a very simple program that detects when a user locks/unlocks their PC and fires off a VBScript (with a parameter) via the ShellExecute method. It works very well except I've noticed that every time I fire the ShellExecute command I loose memory. The first time about 3Mb and then about 50k thereafter. I've recompiled the program without using ShellExecute (not much use but it proved a point) and memory usage was solid. Wouldn't be a problem but some of our customers won't restart or logoff their PCs for weeks at a time.
Before anybody suggests it, I can't put the code in the VBScript in to the complied application for "political" reason
Many thanks,
Pete