[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Cursor position in document

Simon Jefferies

11/20/2002 10:29:00 PM

I am writing a VB.NET addin, and using the EnvDTE.Document class to access
any text documents/cpp files etc...

I am looking for the cursor (not mouse) position in the document. But I can
only get the column or row number, I'm after the X,Y relative to the screen.

Thanks
Simon Jefferies
simonj@headfirst.co.uk



2 Answers

Richard T. Edwards

11/21/2002 4:05:00 AM

0

Add a timer to the project, add the GetCursorPos API, change the longs to
integers:

Public Structure POINTAPI
Public X as Integer
Public Y as Integer
End Structure

Private Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos"
(lpPoint As POINTAPI) As Integer

Enabled the timer and do whateveryou want with the output.

HTH

"Simon Jefferies" <jefferies_simon@hotmail.com> wrote in message
news:ewnusvNkCHA.1756@tkmsftngp12...
> I am writing a VB.NET addin, and using the EnvDTE.Document class to access
> any text documents/cpp files etc...
>
> I am looking for the cursor (not mouse) position in the document. But I
can
> only get the column or row number, I'm after the X,Y relative to the
screen.
>
> Thanks
> Simon Jefferies
> simonj@headfirst.co.uk
>
>
>


Simon Jefferies

11/21/2002 8:44:00 AM

0

Thanks for your reply,

Unfortunately, I need the "blinking" text cursor position rather than the
mouse pointer.

Any ideas?
Simon


"Richard T. Edwards" <r.t.edwards@attbi.com> wrote in message
news:M3YC9.67692$P31.34133@rwcrnsc53...
> Add a timer to the project, add the GetCursorPos API, change the longs to
> integers:
>
> Public Structure POINTAPI
> Public X as Integer
> Public Y as Integer
> End Structure
>
> Private Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos"
> (lpPoint As POINTAPI) As Integer
>
> Enabled the timer and do whateveryou want with the output.
>
> HTH
>
> "Simon Jefferies" <jefferies_simon@hotmail.com> wrote in message
> news:ewnusvNkCHA.1756@tkmsftngp12...
> > I am writing a VB.NET addin, and using the EnvDTE.Document class to
access
> > any text documents/cpp files etc...
> >
> > I am looking for the cursor (not mouse) position in the document. But I
> can
> > only get the column or row number, I'm after the X,Y relative to the
> screen.
> >
> > Thanks
> > Simon Jefferies
> > simonj@headfirst.co.uk
> >
> >
> >
>
>