Results 1 to 6 of 6

Thread: [resolved] Test Colour

Threaded View

  1. #1

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Resolved [resolved] Test Colour

    hey me again ...


    I got this code... All mine
    VB Code:
    1. Public Function TestColor(Colortest As Long) As String
    2. Dim X As Long, Y As Long, test As Long, wndrect As RECT
    3. GetWindowRect selWnd, wndrect
    4. test = GetDC(selWnd)
    5. TestColor = false
    6. For Y = 0 To (wndrect.Bottom - wndrect.Top)
    7.   For X = 0 To (wndrect.Right - wndrect.Left)
    8.    If GetPixel(test, X, Y) = Colortest Then
    9.       TestColor = true
    10.       Exit Function
    11.       Exit Function
    12.     End If
    13.   Next X
    14. Next Y
    15. End Function


    but when i type in

    if testcolor(255)=true then msgbox "Found it"


    if doesnt find it... but if i put in false it does find it....

    I know there is a color 255 on my screen but it all screws up....

    ive tried reversin the true and false statements but it still works in reverse....

    any help?
    Last edited by Hack; Mar 3rd, 2006 at 07:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width