Jump to content
Sign in to follow this  
FalconFour

Detect menu item selection under cursor

Recommended Posts

FalconFour

Okay, I'm an "intermediate" Autoit user, I've made some scripts that automate Windows customization, and one that navigates a script-proofed GUI based on colors and cursor clicks.

Now, I kinda want to make something a little funny. I work at a PC repair shop, and one of my occasional coworkers changes two settings in Task Manager that really irks the hell out of me, "Hide when minimized" and "Always on top". I want to make a little AutoIt script that intercepts these menu selections and moves the cursor away, kinda like the button-you-can't-press.

Problem is, I can look for a window in an infinite loop, wait for it to become active (and start polling more frequently), but I can't figure out how to detect what item is under the cursor, or how to address an item on the screen. All I've worked with so far are hard-coded items :D

So, any ideas on how I can accomplish this? Or even if it's possible? I'd love to stop seeing Task Manager down in the tray with those two options checked every few weeks :huggles:

Share this post


Link to post
Share on other sites
Minikori

Considering the (what I'd assume to be) check boxes are not gonna move within the GUI, you could set up something that would move the mouse to 0,0 if it's within the WindowPos plus the CheckboxPos. I hope that makes sense. :D


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites
FalconFour

That makes sense, but what if the menu isn't open? The same area of the screen is also occupied by the "Processes" tab, which is usually the first thing we click in Task Manager. It'd be kinda telling if the cursor jumped out of the way all the time :D

Share this post


Link to post
Share on other sites
Minikori

That makes sense, but what if the menu isn't open? The same area of the screen is also occupied by the "Processes" tab, which is usually the first thing we click in Task Manager. It'd be kinda telling if the cursor jumped out of the way all the time :D

You could try a PixelGetColor() for a spot that is only a certain color when one of them is open.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites
Minikori

Sorry to bump an old thread, but I just found this: http://www.autoitscript.com/forum/index.php?showtopic=19370&st=140&p=338390&#entry338390

You can do the PixelGetColor() thing to see which tab is open, and if it is, you can enable the _MouseRepel()


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.