Page 1 of 1

coordinates mouse

Posted: Thu Feb 20, 2014 8:47 pm
by damianodec
Hi, i have two questions:
1- I would like the coordinates of mouse (pixel x and Y) when I push dbl-left-click;
2- I woud like the resolution of screen (pixel x and y) when init a WINDOW.
any help?
thanks

Re: coordinates mouse

Posted: Thu Feb 20, 2014 8:59 pm
by cnavarro
To calculate the resolution:

Code: Select all

      nAncho  := GetSysMetrics( 0 ) //ScreenWidth()  //GetSysmetrics( 4 )
      nAlto   := GetSysMetrics( 1 ) //ScreenHeight() //GetSysmetrics( 3 )
 

Re: coordinates mouse

Posted: Thu Feb 20, 2014 9:03 pm
by cnavarro
All controls have the following METHOD LDblClick and blDblClick DATA that you can program.
The method always receives the row and column location of the mouse

Code: Select all

METHOD LDblClick( nRow, nCol, nKeyFlags )
 

Re: coordinates mouse

Posted: Thu Feb 20, 2014 9:05 pm
by Enrico Maria Giordano
Damiano,
damianodec wrote:Hi, i have two questions:
1- I would like the coordinates of mouse (pixel x and Y) when I push dbl-left-click;

Code: Select all

bLDblClick = { | nRow, nCol | MsgInfo( nRow ), MsgInfo( nCol ) }
damianodec wrote:2- I woud like the resolution of screen (pixel x and y) when init a WINDOW.

Code: Select all

MsgInfo( GetSysMetrics( 0 ) )
MsgInfo( GetSysMetrics( 1 ) )
EMG

Re: coordinates mouse

Posted: Thu Feb 20, 2014 9:49 pm
by damianodec
thanks

Re: coordinates mouse

Posted: Sat Feb 22, 2014 9:17 pm
by Lailton
mouse position.
mgsinfo(hb_dumpvar(getcursorpos()))

Re: coordinates mouse

Posted: Sun Feb 23, 2014 4:53 am
by FranciscoA
Lailton, podrías indicar si la function getcursorpos() se encuentra en xHarbour, y en que version?
Gracias.

Re: coordinates mouse

Posted: Sun Feb 23, 2014 8:39 am
by Enrico Maria Giordano
Francisco,
FranciscoA wrote:Lailton, podrías indicar si la function getcursorpos() se encuentra en xHarbour, y en que version?
Gracias.
GetCursorPos() is a FWH function.

EMG

Re: coordinates mouse

Posted: Sun Feb 23, 2014 2:37 pm
by Lailton
Its a function of fivewin that return X,Y position of mouse.

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Re: coordinates mouse

Posted: Sun Feb 23, 2014 2:53 pm
by FranciscoA
Enrico, Lailton:
Muchas gracias.
Saludos.