Jump to content

PixelGetColor gets desktop color instead of active winow


Siflou
 Share

Recommended Posts

Hey Guys, I have a VM on virtual box and Windows XP service pack 3 installed. And I have a script that doesn't get the color like I wanted to do. I figured out that it get the desktop color instread of the active window because I switched background and the color were similar as my background but never the color that I wanted to be. I have to mention that it actually works on my other computer with Vista on it and also my laptop with windows 7. Here is an example of test :

Somebody have any idea ? Thanks a lot.

/code

#RequireAdmin

Sleep(3000)

$x = 1010

$y = 25

$var = PixelGetColor($x,$y)

MouseMove ($x, $y, 0)

MsgBox(0,"The decimal color is", $var)

/code

Link to comment
Share on other sites

I dont know how "Activate the window" can be explained more clearly but I'll try.

Make sure the window you are performing the search on is active.

I assume you have Autoit Installed on the vertual machine?

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Yes, I have autoit installed on the VM and I use the last version of autoit

I tried the code :

#RequireAdmin

WinActivate("MyWindow")

Sleep(3000)

$x = 1010

$y = 25

$var = PixelGetColor($x,$y)

MouseMove ($x, $y, 0)

MsgBox(0,"The decimal color is", $var)

To activate the window but it doesn't work. Any idea ?

Link to comment
Share on other sites

Try this

#RequireAdmin
  $x = 1010
  $y = 25
  WinActivate("MyWindow")
  WinWaitActive("MyWindow")
  $var = PixelGetColor($x,$y)
  MsgBox(0,"The decimal color is", $var)
Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

It still provide the background colors. But I found maybe something interesting. When I use the window info tools info on my program, it still return the desktop color instead of my program color. Remember that I use a Virtual box VM with windows xp pro sp 3. Maybe it could help.

Link to comment
Share on other sites

In the window info tool, I checked "Magnify" and I see in big character that it gets the color of my desktop and its like if my start menu is open, because i See like in big characters "courriel electronique" with the logo, msn with logo. Also, I tried the info tools with Windows media player and it worked perfectly, so maybe its the program ? My program is a game called knight online. But it still works perfectly on my other computers. Can some one help me please I really want to fix it up

Edited by Siflou
Link to comment
Share on other sites

My program is a game called knight online. But it still works perfectly on my other computers. Can some one help me please I really want to fix it up

knight online?

you already had one redirect to forum rules about game automation on your first topic, and i can see that you're asking this in two topic + you resurrected one old topic

try to read them one more time

Posted Image

reported

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

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