Jump to content

PixelGetColor misses hWnd parameter?


 Share

Recommended Posts

using VB.NET

tried both options, with value zero instead of two also:

AutoIt.AutoItSetOption("CaretCoordMode", 2)

AutoIt.AutoItSetOption("PixelCoordMode", 2)

even tried to set default hWnd but it did not worked

hWin = AutoIt.WinGetHandle(WinName)

btw, controlsend is useless if I don't have control ID? I just wanted to type in the window, not in a specific control

AutoIt.ControlSend(hWin, "", "", "p")

And well, this line is getting the color of the active window instead of the window I want the colors from. I mean, it's taking the colors of my form instead the game window I want. And PixelGetColor can't have a third parameter like in AutoIt3

Dim col AS String = AutoIt.PixelGetColor(i, j)

What am I supposed to do? Which is not setting the game as the active window, I would want to do other things meanwhile the game is running.

Thanks,

Link to comment
Share on other sites

Hello pantallazo,

Welcome to the AutoIt Forums!

First off, in AutoIt3 Pixel functions need the window to be active, on top, and in the monitor view in order to work properly.

Try first activating the window with

WinWaitActive()

If you still having problems with it. Then set the Pixel Coordinate Mode in your script to match the mode in which you obtained the coordinates.

Opt('PixelCoordMode',?)

Realm

Edit:

Use the 'Autoit Window Info' Tool provided with the 'AutoIt3' Download to obtain your coords. It has matching Modes to the options in which to obtain the coords.

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

Link to comment
Share on other sites

First off, in AutoIt3 Pixel functions need the window to be active, on top, and in the monitor view in order to work properly.

Isn't it possible to get the pixel color of a not active window but visible?

$hwnd = WinGetHandle("Window name")

PixelGetColor ( $x , $y, $hwnd )

This should work with AutoIt3, isn't it?

Link to comment
Share on other sites

PixelGetColor() reads the screen*, not windows.

Now go read the forum rules so you know why you just got reported and the thread was locked.

*Not really, but you get the point

Edited by AdmiralAlkex
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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