I abhor VB, but the thing can be done in VB.NET & C#.NET as
Code:
Process.Start(@"C:\WINDOWS\system32\rundll32.exe", "user32.dll,LockWorkStation");
Which is nothing but calling rundll32.exe with a set of parameters, which in turn hooks to user32.dll ergo calling LockWorkStation() of the Windows API.
If this is too much hassle, you can opt to
dllimport user32.dll's LockWorkStation() directly into your project.
Regarding post #2,
If the form is the Main form, you'll have to use persistence to manually read & write settings to the disk. If the form is a secondary/child form, you can hook it's OnClosing() event to instead Hide() it, ..... or you can save its settings in the parent form.