I have a program that runs as a service under Win2k/XP pro/Vista etc that needs to know if someone is logged on before it tries to launch a vb6 application that I want to run. I realize I could start the vb6 application up in the startup menu, but need to tell the service program to be quiescent if the user logs off, so its best if the service program can tell if anyone is logged on else have it be quiet.
The service program was written in PowerBasic which has syntax that is very close to vb6. With a user logged on and the vb6 program running the service basically checks in with the vb6 program to see if its running correctly. If it gets stuck the service program closes it and/or restarts it. Because the vb6 program has some screens that display I don't want to attempt to start the vb6 program if no one is logged on.
Everything, so far is working great, but I need a way for the PowerBasic program to tell if someone is logged on. A solution written for Vb6 will translate easily to PowerBasic so the person answering can assume I'm writing my solution in vb6.
I found a sample project on line that uses NetUserGetInfo where I can tell if someone is logged on if I know their logon name in advance, but nothing where I can check if anyone is logged on. Any hints?
Thanks in advance.