RES: [VBCOM] Absolute position (Left, Top) of a control in the screen

Ronaldo Nogueira <[email protected]> Fri, 3 May 2002 09:02:49 -0300
Newsgroups gmane.comp.windows.devel.vbcom
Message-ID <[email protected]>
Thank you very much, Dave, it is exactly what I was looking for.

Regards,

Ronaldo


-----Mensagem original-----
De: VBCOM [mailto:[email protected]]Em nome de David Symanowicz
Enviada em: quinta-feira, 2 de maio de 2002 19:33
Para: [email protected]
Assunto: Re: [VBCOM] Absolute position (Left, Top) of a control in the
screen


Hi Ronaldo,

You can use ClientToScreen(Me.hWnd,lpPoint).  The x and y members of the
POINTAPI Type will be in respect to the screen when the function returns.

Public Declare Function ClientToScreen Lib "user32" Alias "ClientToScreen" _
                (ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Public Type POINTAPI
        x As Long
        y As Long
End Type


Hope that's what you were looking for...

Regards,

-Dave



-----Original Message-----
From: VBCOM [mailto:[email protected]]On Behalf Of Ronaldo
Nogueira
Sent: Thursday, May 02, 2002 5:28 PM
To: [email protected]
Subject: [VBCOM] Absolute position (Left, Top) of a control in the
screen


Hi,

The left and top properties of a control give its relative position
regarding its container, whose left and top properties give its relative
position, and so on. Can anybody help me on how to obtain the absolute left
and top properties of a control regarding the screen? I need it to position
a modal form based on the coordinates of the caller control.

Thanks in advance

Regards,

Ronaldo

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.