AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PixelGetColor for other windows

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
qallaf
Guest





PostPosted: Sat Jun 30, 2007 4:43 am    Post subject: PixelGetColor for other windows Reply with quote

i want to make loop on that code but while i am in other window and maybe the color chages.....

that code is in window1 and when i make it loop on it and i am on window2

it dosent work!! coz PixelGetColor works for current window only
how to make PixelGetColor on window1 and while i am busy with window2


Code:

PixelGetColor, color, 625, 753

  if (color = 0x393939)
  {
MouseClick RIGHT, 877, 25
 }
Back to top
ManaUser



Joined: 24 May 2007
Posts: 1121

PostPosted: Sat Jun 30, 2007 4:54 am    Post subject: Reply with quote

I'm guesing the problem is that by default, PixelGetColor uses coordinates relative to the active window. So obviously if you make a different window active it will be messed up. You can use CoordMode Pixel, Screen to switch to coordinates relative to the screen, but you'll have to adjust your coordinates to compensate. However you should also be aware that if the pixel you need to check is covered by another window, you wont' be able to check it, at all.
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1786

PostPosted: Sat Jun 30, 2007 5:35 am    Post subject: Reply with quote

you could do something ridiculous like work out the wanted windows relative position on the screen, so that you always know its coordinates rather than relative coordinates in the active window, so that when its inactive then you still know its last coordinates, and now for the ridicuolous part....make it so that a loop is formed with any window in z ordering above the specific window has a 1 pixel transparent dot at the part that is being checked? lol. would be complex code, but should work, and would also be a tiny bit messy that you would appear to have a dead pixel on your screen if there was anything over the wanted window
Back to top
View user's profile Send private message
qallaf
Guest





PostPosted: Sat Jun 30, 2007 2:09 pm    Post subject: Reply with quote

i want to do that plz
Back to top
svi



Joined: 09 Oct 2006
Posts: 236
Location: Finland

PostPosted: Sun Jul 01, 2007 6:57 pm    Post subject: Reply with quote

qallaf wrote:
i want to do that plz
So what's the problem?
If you want to check a pixel under a window / windows, then make the above window(s) "tranparent".
Value 255 means opaque (not at all tranparent / translucent), I think, but you can still get the pixel under such window(s).

The Manual wrote:
A window that is partially transparent or that has one of its colors marked invisible (TransColor) typically yields colors for the window behind itself rather than its own.

_________________
Pekka Vartto
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1786

PostPosted: Mon Jul 02, 2007 1:26 am    Post subject: Reply with quote

i dont think its quite as easy as that. you have to do this to only the windows above the one youre checking. it would be very complex code
Back to top
View user's profile Send private message
ManaUser



Joined: 24 May 2007
Posts: 1121

PostPosted: Mon Jul 02, 2007 3:00 am    Post subject: Reply with quote

You know, the reverse would be alot easier. Make the widnow you're interested in AlwaysOnTop, then hide everything but the one pixel you want to check using WinSet Region.
Back to top
View user's profile Send private message
Sukarn



Joined: 16 Jun 2007
Posts: 35

PostPosted: Mon Jul 02, 2007 8:47 am    Post subject: Reply with quote

ManaUser wrote:
You know, the reverse would be alot easier. Make the widnow you're interested in AlwaysOnTop, then hide everything but the one pixel you want to check using WinSet Region.


I like that idea.
Back to top
View user's profile Send private message
svi



Joined: 09 Oct 2006
Posts: 236
Location: Finland

PostPosted: Mon Jul 02, 2007 9:47 am    Post subject: Reply with quote

ManaUser wrote:
... the reverse would be alot easier.
Indeed!

Also having many transparent windows (even level 255) causes "performance penalty". Even one tranparency seems to be too much if the window in case is video window Smile

But AlwaysOnTop is not always possible. At least I don't know a way to have WMP:s normal window on top of fullsreen WMP (in fullsreen mode there's really two WMP windows!).
_________________
Pekka Vartto
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group