Jump to content

Recommended Posts

Posted (edited)
6 hours ago, Nine said:

Let me know if you have used it...

Yes, I have used it :lol:. However, my concentration is almost zero at this time of day. So I can only tell you that it works for me. The screenshot is a bit blurry in some areas.

Spoiler

Test-Area.jpg.01945236fc890bfa9b855886e666d0a6.jpg

(EDIT : Excerpt of the screenshot packed into a spoiler.)

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

I tried _GetScreen_GetPixel function but it returns a different color than au3info even when Aero is on or off for WIN 7

Posted

I use: _GetScreen_GetWindow($hWnd) _GetScreen_GetPixel($iX, $iY) It does not return the color of the handle. seems to return the color of all on the screen

Posted

So the UDF can't get the color of the handle when it's overridden? I see when I save the file, it captures the handle, why can't I get the color when it's obscured 😰

Posted

Listen. You do not understand.  It is working perfectly fine.   You need to setup info tool for window not screen.  You need to make window scale 100%.  It is working for background and foreground.  Stop repeating it is not working and show the code and results and the setup of info tool, etc.

Posted

I find myself a bit annoyed. Because I re-read it with google translate, so I don't understand it very well. I have adjusted the coordinate information to windows, so I got the correct color. Since all the code I used before was taking the coordinates with the client, now that I switch to windows, I have to start all over again. Is there a way to make the UDF use coordinates from the client?

Posted (edited)

you could substract the client x,y from the screen x,y ( at 0,0 usually ) and get those ? Or add the client X,Y to the screen ?
There is code in the help file that has the x,y example  ( GUICtrlCreateContextMenu > Func ClientToScreen($hWnd, ByRef $x, ByRef $y) )

Edited by argumentum
added link

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted (edited)
3 hours ago, Loc said:

so I got the correct color

Glad you made it work.

3 hours ago, Loc said:

Is there a way to make the UDF use coordinates from the client?

Yes, but I will not, it would make my UDF slower.  This is out of question. ;)

However, here the way you can calculate the delta of Window and Client Area :

#include <StructureConstants.au3>
#include <Constants.au3>
#include <WinAPIConv.au3>
#include "..\GetScreen\GetScreen.au3"

Local $hWnd = WinGetHandle("[CLASS:SciTEWindow]")

; this calculates the screen position of the window
Local $aWin = WinGetPos($hWnd)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "", "Window not found")
Local $Width = $aWin[2], $Height = $aWin[3]

; this calculates the screen position of the client area of the window
Local $tPoint = DllStructCreate($tagPOINT)
$tPoint.X = 0
$tPoint.Y = 0
_WinAPI_ClientToScreen($hWnd, $tPoint)
Local $xDiff = $tPoint.X - $aWin[0], $yDiff = $tPoint.Y - $aWin[1]

MsgBox($MB_SYSTEMMODAL, "", "Diff from Window to Client = " & $xDiff & "/" & $yDiff)

_GetScreen_Initialize($Width, $Height)
_GetScreen_GetWindow($hWnd)

Local $color = _GetScreen_GetPixel(52+$xDiff, 122+$yDiff) ; 52 and 122 are client coordinates
MsgBox($MB_SYSTEMMODAL, "", Hex($color, 6))

You just need to calculate it once (at the beginning of the script) and reuse the deltas for each call to get pixel...

Edited by Nine

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
  • Recently Browsing   0 members

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