Jump to content

Getting Pixel Checksum of Control


bsg273
 Share

Recommended Posts

I've got a pesky checkbox in a login window (the vSphere Client login window) that causes AutoIt's controlCommandIsChecked to always return false regardless of if the box is checked or not. Thus, I decided to resort to performing a pixel checksum on the checkbox's control to determine if it's checked or not based on the checksum value. I must be doing something wrong though because it's not computing the checksum of the appropriate area at all. Here's what I came up with (I'm using Java) ...

AutoItX autoIt = new AutoItX();
String loginWindow = "VMware vSphere Client";

double pchecksum = autoIt.pixelChecksum(autoIt.controlGetPosX(loginWindow, "", "[NAME:checkUsePassthrough]"), +
    autoIt.controlGetPosY(loginWindow, "", "[NAME:checkUsePassthrough]"), +
    autoIt.controlGetPosX(loginWindow, "", "[NAME:checkUsePassthrough]")+autoIt.controlGetPosWidth(loginWindow, "", "[NAME:checkUsePassthrough]"), +
    autoIt.controlGetPosY(loginWindow, "", "[NAME:checkUsePassthrough]")+autoIt.controlGetPosHeight(loginWindow, "", "[NAME:checkUsePassthrough]")));

Any suggestions as to what I'm doing wrong here in capturing the coordinates of the control to compute the pixel checksum?

Link to comment
Share on other sites

  • Developers

​I have no idea what that means.  Could you please explain?

​so you of course opened the Helpfile and did a search for it before asking ....  right? ;)

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...