Mouse Position??

Rabbit

Member
I have a single image which have 4 portion. I want to call different program when I click on different part of the image. How can I know which portion the mouse is clicked on?
 

Jupiter

Member
Code:
Define Var vX As Int Extent 2 No-undo.
Procedure GetCursorPos External "USER32.DLL":
    Define Output Parameter vX As Long.
End Procedure.
Run GetCursorPos (Output vx).
Message  vx[1] vx[2]
    View-as Alert-box Info Buttons Ok.

The above code returns you mouse positions. The rest should be easy. :)
 

Rabbit

Member
I got an error message 1183 (Cannot pass arrays as run-time parameter). Is it because I am using V8.3?
 

Jupiter

Member
Code:
Define Variable vx As Memptr.
Set-size (vx) = 8.
Procedure GetCursorPos External "USER32.DLL":
    Define Output Parameter vX As Memptr.
End Procedure.
Run GetCursorPos (Output vx).
MESSAGE Get-long (vx,1) Get-long (vx,5)
    VIEW-AS ALERT-BOX INFO BUTTONS OK.

Please check if this works with the version you are working.
 

jdgibson

New Member
I have a single image which have 4 portion. I want to call different program when I click on different part of the image. How can I know which portion the mouse is clicked on?

The last-event system handle will give you the x and y cooridinates of the last mouse click.

last-event:x
last-event:y

is the syntax. It can give you a few other things as well
 
Top