dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: VB 6.0 Graphic detection! X and Y Position

  1. #1
    Join Date
    Oct 2010
    Location
    RO
    Posts
    3

    Question VB 6.0 Graphic detection! X and Y Position

    Hello !
    I have this image : http://img842.imageshack.us/img842/6536/boxgn.jpg

    How do i detect the image X and Y position if this image is on a flash and appears random ?

  2. #2
    Join Date
    Oct 2010
    Location
    RO
    Posts
    3

    Unhappy ?!

    Someone answer ?!

  3. #3
    Join Date
    Oct 2010
    Posts
    22

    Image

    Are you saying Image is a flah video, picturebox, form, another program...?

  4. #4
    Join Date
    Oct 2010
    Location
    RO
    Posts
    3

    ...

    No, the image is on a Flash (swf-webpage) not on the 'form' not in picturebox

    I need to know the aprox. x and y location of that graphic

    After that i will use this code to point the mouse cursor to the image

    Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal Dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)


    Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

    Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Public Const MOUSEEVENTF_LEFTDOWN = &H2
    Public Const MOUSEEVENTF_LEFTUP = &H4
    Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
    Public Const MOUSEEVENTF_MIDDLEUP = &H40
    Public Const MOUSEEVENTF_RIGHTDOWN = &H8
    Public Const MOUSEEVENTF_RIGHTUP = &H10
    Public Const MOUSEEVENTF_MOVE = &H1


    Public Type POINTAPI
    X As Long
    Y As Long
    End Type


    Public Function GetX() As Long
    Dim n As POINTAPI
    GetCursorPos n
    GetX = n.X
    End Function


    Public Function GetY() As Long
    Dim n As POINTAPI
    GetCursorPos n
    GetY = n.Y
    End Function


    Public Sub LeftClick()
    LeftDown
    LeftUp
    End Sub


    Public Sub LeftDown()
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    End Sub


    Public Sub LeftUp()
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
    End Sub


    Public Sub MiddleClick()
    MiddleDown
    MiddleUp
    End Sub


    Public Sub MiddleDown()
    mouse_event MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0
    End Sub


    Public Sub MiddleUp()
    mouse_event MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0
    End Sub


    Public Sub MoveMouse(xMove As Long, yMove As Long)
    mouse_event MOUSEEVENTF_MOVE, xMove, yMove, 0, 0
    End Sub


    Public Sub RightClick()
    RightDown
    RightUp
    End Sub


    Public Sub RightDown()
    mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
    End Sub


    Public Sub RightUp()
    mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
    End Sub


    Public Sub SetMousePos(xPos As Long, yPos As Long)
    SetCursorPos xPos, yPos
    End Sub


    I will buy you a beer ! thanks
    Last edited by freshmeat; 10-25-2010 at 08:27 AM.

Similar Threads

  1. MMFAN Retires
    By MMFAN in forum .NET
    Replies: 20
    Last Post: 09-22-2002, 11:54 PM
  2. Access 2000 and VB 6.0 compatability.
    By Idiotman in forum VB Classic
    Replies: 5
    Last Post: 07-12-2002, 11:38 AM
  3. Upgrading a VB 6.0 Project to VB .Net
    By RajaSingh R. in forum .NET
    Replies: 1
    Last Post: 05-01-2002, 05:48 PM
  4. Replies: 2
    Last Post: 11-29-2001, 11:38 AM
  5. Replies: 2
    Last Post: 11-28-2001, 01:14 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center