• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

How can I detect and draw a border around a control or window currently under the mouse outside my application?

I want to draw a border around the control or window that the mouse is currently over whilst my controlling application is minimised.  I would then want to use the co-ordinates of the border as a parameter to a screen capture application.

Chris Bray
0
chrisbray
Asked:
chrisbray
  • 3
  • 3
  • 2
1 Solution
 
CuteBugCommented:
I think this is what you are looking for

http://www.codeproject.com/KB/cs/TeboScreen.aspx
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
0
 
chrisbrayAuthor Commented:
Hi CuteBug,

No, I am afraid that it isn't.   I have seen that application, and its source, but it does not do what I asked...

I wish to be able to determine which window or control is under the mouse when my application is minimised, and draw a border around it.

Chris Bray
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
*You'll obviously need to integrate the hook code from your PAQ (or use a Timer).  The crux is to use WindowFromPoint() and GetWindowRect().
0
 
CuteBugCommented:
Here is a code in MSDN (written in VB)...

http://support.microsoft.com/kb/143045

You need to convert it to C#.
0
 
chrisbrayAuthor Commented:
Hi IdleMind,

OK, that makes sense.  Given that I can use those API calls to get the required information, how can I then draw the border?

Chris Bray
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
In the PAQ I use ControlPaint.DrawReversibleFrame()...
0
 
chrisbrayAuthor Commented:
This looks like it will do the job for me - I haven't got it fully working yet but won't have time to complete before this question would expire, so I will award the points now.

Thanks for the answers...
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now