Results 1 to 1 of 1

Thread: How add fixed mouse pointer to my app?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    How add fixed mouse pointer to my app?

    Hi all i am using this code to get Pixel Color Outside my form. Now i need to move the mouse around and it shows the pixel color for me in textbox and picture box of my app.


    What i want to do add a mouse pointer to this app so i just click on part of any application and it just monitors that part for me all the time and remembers that cordinate of screen. in another word the app some how should remember all the time what postion of screen to look for Pixel Color at by only once clickiing on the spot. I be happy if some one show me how i can add that option to this app.Thanks

    I anotherword monitoring fixed screen position's/point's Pixel Color Outside my form.

    VB Code:
    1. Dim z As POINTAPI
    2. Private Sub Timer1_Timer()
    3.     GetCursorPos z
    4.     screendc = CreateDC("DISPLAY", "", "", 0&)
    5. 'replace the line below with:  Text1 = Hex(GetPixel(screendc, z.x, z.y))
    6. 'if you want that the text box will show the Hex value of the color (the Hex value is
    7. 'used to define colors in HTML)
    8.     Text1 = GetPixel(screendc, z.x, z.y)
    9.     Picture1.BackColor = GetPixel(screendc, z.x, z.y)
    10.     DeleteDC (screendc)
    11. End Sub
    12.  
    13.  
    14.  
    15. module code:
    16.  
    17. Declare Function CreateDC& Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, _
    18. ByVal lpDeviceName As String, ByVal lpOutput As String, lpInitData As Any)
    19. Declare Function DeleteDC& Lib "gdi32" (ByVal hdc As Long)
    20. Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, _
    21. ByVal y As Long) As Long
    22.  
    23. Type POINTAPI
    24. x As Long
    25. y As Long
    26. End Type
    27.  
    28. Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Attached Images Attached Images  
    Last edited by tony007; Jun 22nd, 2006 at 06:57 PM.

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