Your code is fine and the reason for the exception is quite obvious too... if you check the pic on my post #30 i showed you how to explore your objects so you can debug your code and check your array of processes. if you check few of the array items you will notice that under the main module and in other areas the access is restricted and for that reason you´re getting that exception.
a simple:
Code:
Try
{
//Your code
}
Catch{}
should do the trick for now.. there are other ways but probably too complicated for you atm.
__________________
Current development tools:
Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6
Last edited by @ruantec; June 10th, 2009 at 10:41..