views:

34

answers:

0

I'm trying to write a password storing application (similar to KeePass, for practice purposes), and i would like this application to have a selection mode similar to Spy++'s Find Window function.

The goal is to obtain a window handle to a password control the user selects, so that my app can send a stored password to this control, perhaps via WM_SETTEXT, without utilizing the clipboard or SendKeys method.

  1. Is this possible with .NET?
  2. How do i obtain a control's hWnd by mouse click, if it's in a different application/process?

Edit: I'm using WPF, not WinForms...but theoretically that shouldn't make much of a difference here.