Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I'm want to get object handle by mouse position in desktop.
How I can do it?
Posted
Updated 5-Aug-11 5:22am
v2
Comments
OriginalGriff 5-Aug-11 8:54am    
Sorry? Do want to try that again, only this time using sentences that describe what you are trying to achieve?
Richard X Menezes 5-Aug-11 9:08am    
Could you be more clear on the question.
[no name] 5-Aug-11 11:20am    
I'm want to get Object handle in mouse position .
Yvan Rodrigues 9-Aug-11 8:20am    
Does the control under the mouse belong to the running process?

1 solution

I need more information to answer this, but here's how one would get the handle of a control that has been clicked.
var clickMe = new Panel();
parent.Controls.Add(clickMe);
clickMe.MouseClick += (sender, e) => MessageBox.Show("The control's handle is " + (sender as Control).Handle);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900