Results 1 to 2 of 2

Thread: RGB color and Mouse

  1. #1
    DaoK
    Guest

    RGB color and Mouse

    I want to make a program than the person add in a text box color they want in RGB (Exemple 255,255,255). And In a timer I want The mouse go search ( have the focus) in the screen (desktop, icon, all windows open) the colors choosen.

    IS it posible?

  2. #2
    DaoK
    Guest
    This is what I did for moment :

    Code:
    'Module
    Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
    
    'Declaration
    
    
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Private Type PointAPI
            x As Long
            y As Long
    End Type
    Private Pos As PointAPI
    
    'Form
    
    Private Sub Form_Load()
    Label1.BackColor = RGB(150, 200, 175)
    End Sub
    
    Private Sub Timer1_Timer()
    alphaX = RGB(150, 200, 175)
    alphaY = RGB(150, 200, 175)
    GetCursorPos Pos
    Caption = Pos.x - (Left / Screen.TwipsPerPixelX) & "," & Pos.y - (Top / Screen.TwipsPerPixelY)
    SetCursorPos alphaX, alphaY
    End Sub
    Of course that doesnt work and I put a label just for the test becasue I want that work anywhere after.
    Please help me

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