Jump to content

Context Menu


Recommended Posts

Is there a way in autoit to check if a context menu is open? My scrip halts every time there is a context menu open.

To explain:

I run a computer lab at an elementary school and if the students change the wallpaper I will remotely run a script that puts the wallpaper back.

What happens is if one of the computers has a context menu open it will not Send the Enter key. Therefore not completing the portion of the script.

Here is an portion of the script:

;Computer Lab Display Theme will be applied.
Send("#m",0)
ShellExecute($Local&"\Lab Theme.Theme")
sleep(1000)
ControlFocus("Display Properties", "", "")
WinwaitActive("Display Properties")
Send("{ENTER}",0)
WinWaitClose("Display Properties")
ControlFocus("Program Manager", "", "")
Link to comment
Share on other sites

Get information on the Display Properties window with AU3Info and try ControlSend() vice Send(). That won't require the target window to be active or have focus.

More generally, are the lab machines in a domain? Why not just set a policy to prevent users from changing wallpaper in the first place?

:idea:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Get information on the Display Properties window with AU3Info and try ControlSend() vice Send(). That won't require the target window to be active or have focus.

More generally, are the lab machines in a domain? Why not just set a policy to prevent users from changing wallpaper in the first place?

:idea:

Thanks for the help.

They are on a domain, however I am not the domain administrator. The domain that they belong to is controlled by the School District IT department and we have about 50 schools not including Office Buildings. I try to handle my small lab with out them as much as I can.

Link to comment
Share on other sites

They are on a domain, however I am not the domain administrator. The domain that they belong to is controlled by the School District IT department and we have about 50 schools not including Office Buildings. I try to handle my small lab with out them as much as I can.

I'm sympathetic, but if the student accounts are in an OU (or a few OUs) already then they could add a policy to that in about 30 seconds that would take this entire problem off your hands. Bait them with Diet Pepsi and Cheesy Poofs (a universal weakness for power-mad School District IT departments), and get them to do it.

:idea:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...