Jump to content

Recommended Posts

Posted

I am curious if AutoIT is functional in the case where no user is logged in and no desktop exists. I have an application that is started by a service. When the system starts my application is started. I would like to have AutoIT run by this application, but it is apparently not recognizing application windows. I suspect it searches for windows via the desktop, which is causing a problem when there is none.

Are there options I should try or is this unworkable?

Posted (edited)

I am pretty sure that the desktop has to be active for GUI scripts to work, but if your task can be scripted without GUI interaction there shouldn't be a problem....at least in my experience.

Edited by spudw2k
Posted

You can idle your script until it detects that someone is logged on (and the desktop is therefore active).

Take a look at this post for logon detection:

To add another layer of verification, you can also check if both the Taskbar and the Desktop already exist.

Taskbar: WinGetHandle("[Class:Shell_TrayWnd]")

Desktop: WinGetHandle("Program Manager")

Either one will return "" if they're not present.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...