Windows Develop Bookmark and Share   
 index > Windows Forms General > Getting controls under mouse pointer
 

Getting controls under mouse pointer

Hi all,

Is it possible to know which control is under the mouse? Say I am using photoshop and my mouse is over a spinner, can I find out which control it is? If so, can I change it's value?

Thanks,

aw

Joan Venge  Thursday, June 07, 2007 9:09 PM
You can use WindowFromPoint() to retrieve the window at a specific coordinate like the mouse position.
Andreas Johansson  Friday, June 08, 2007 12:31 AM

What kind of application? You can not directly manipulate controls in other applications as far as I know, you could simulate mouse/keyboard events to some extent.

Andreas Johansson  Tuesday, June 12, 2007 9:32 PM
You can use WindowFromPoint() to retrieve the window at a specific coordinate like the mouse position.
Andreas Johansson  Friday, June 08, 2007 12:31 AM

Thank you for replying. But even if I have a handle to an application, I still can't access it's ui controls, right? Like one of it's textboxes, where I could get/set the content?

Thanks again,

aw

Joan Venge  Tuesday, June 12, 2007 4:27 PM

What kind of application? You can not directly manipulate controls in other applications as far as I know, you could simulate mouse/keyboard events to some extent.

Andreas Johansson  Tuesday, June 12, 2007 9:32 PM

Thanks for replying. It's photoshop. I was wondering, if I could access one of it's controls, like the hue slider, so my app, could change it like you were adjusting it.

Thanks again,

aw

Joan Venge  Wednesday, June 13, 2007 1:50 AM

You can use google to search for other answers

Custom Search

More Threads

• Keeping an MDI child window on top always
• How to modify HScrollBar
• What is the equivalent of VB's AddHandler statement in C#
• Make a RichTextBox manually sizeable
• Form Design
• something wrong with DateTimePicker and ShowCheckBox
• Sticky question
• RichTextBox page breaks
• C# APP: Update the combobox while using a datasource
• Drop down menu on a button ?