We help IT Professionals succeed at work.
Get Started

Is there any way to tell if someone is logged on to the computer?

KenLevin asked
Last Modified: 2013-12-26
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.

Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE