CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Location
    Singapore
    Posts
    57

    highlighting window under the cursor

    Anyone knows how do i draw a border around any window below the mouse cursor?

    And also, how do i detect a mouse click and the flags when i clicked the mouse
    outside of my application?

    thanks


  2. #2
    Join Date
    Jul 2000
    Location
    Buenos Aires, Argentina
    Posts
    278

    Re: highlighting window under the cursor

    I can help you solve the first problem. If you find my solution useful, I suggest you to post the second part of your problem to get attention of others and get help as well.

    To draw a border arround any window below the cursor you can create a timer. Then, inside the OnTimer() function get the point where the mouse is at that moment using the GetCursorPos() funcion. Afterwards you can get a pointer to the the window below that point using the GetWindowFromPoint() function. You can then create a screen DC using CClientDC dc(NULL); and then draw a rectangle for example whith the coordinates obtaind form GetWindowRect().

    **************************************************
    Please, don't forget to rate my post.
    If you need further help, send me a message!

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured