See whether mouse is on a link -- web browser
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: See whether mouse is on a link -- web browser

Hybrid View

  1. #1
    Join Date
    May 2011
    Posts
    4

    Wink See whether mouse is on a link -- web browser

    Hey, I am creating a web browser which is a bit like chrome/ ie in the sense that I want the context menu strip to change once a link is hovered upon.

    So when you right click on a link it displays a different context menu to the one before if no link has the mouse hovered on them.

    Thanks in advance!

    Basically when a link is hovered upon I would like to see if it is a link and if it is then to change the web browser's context menu

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,000

    Re: See whether mouse is on a link -- web browser

    Well question one: why are you doing this? If it's a student project, to learn or for fun, then that's fine. If it's for something real that you plan to use, I'd go with a ready-made solution. (Either just using a web browser -- there are lots of small ones if you don't like FF/IE/Opera/Chrome/Safari or use a code library for C#).

    Anyway, I'm not sure. Presumably you could figure out the coordinates on the screen of the rectangle (or rectangles if it splits across lines) that enclose the link. Then you could use the MouseMove or MouseHover events of the control to check if the mouse if in one of the link-rectangles and display the appropriate message on the status strip.

    I suspect that solution would be non-trivial, but not impossible.

    Anyone else have a better solution?
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Join Date
    May 2011
    Posts
    4

    Re: See whether mouse is on a link -- web browser

    As a way of learning for my computer program GCSE -- a bit like revision

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,000

    Re: See whether mouse is on a link -- web browser

    Fair enough; there is never anything wrong with programming to learn!

    Good luck with your exams!
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  5. #5
    Join Date
    May 2011
    Posts
    4

    Re: See whether mouse is on a link -- web browser

    Thanks

  6. #6
    Join Date
    May 2011
    Posts
    4

    Re: See whether mouse is on a link -- web browser

    I have got the answer, by using csEXWB -- a .Net wrapper

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center