S
Steve
Hi guys,
You know how annoying it is when Visual Studio keeps asking you for a
username and password to access TFS? I figured it would be easy to
write a little System Tray utility that could use SendKeys to enter
the username and password into the dialog box and click the OK button.
(I ultimately plan on making the application generic so that it'll
work with any application that requires information to be entered in a
dialog box.)
I figured wrong! Actually sending keys to an application using
SendKeys is very easy. (There's a SendKeys class in the Diagnositcs
namespace.) The hard part is making sure the correct window has focus,
since the password window shown by Visual Studio is a modal dialog box
within the devenv.exe process.
So, the question is, does anyone know how to set focus to a modal
dialog box of an another application from a C# application? I've tried
enumerating through the Process to get the window, and I've tried
using varios API calls (ShowWindow, FindWindowEx, etc...) but nothing
has worked thus far.
I'd be most grateful for any suggestions.
Thanks in advance,
Steve.
You know how annoying it is when Visual Studio keeps asking you for a
username and password to access TFS? I figured it would be easy to
write a little System Tray utility that could use SendKeys to enter
the username and password into the dialog box and click the OK button.
(I ultimately plan on making the application generic so that it'll
work with any application that requires information to be entered in a
dialog box.)
I figured wrong! Actually sending keys to an application using
SendKeys is very easy. (There's a SendKeys class in the Diagnositcs
namespace.) The hard part is making sure the correct window has focus,
since the password window shown by Visual Studio is a modal dialog box
within the devenv.exe process.
So, the question is, does anyone know how to set focus to a modal
dialog box of an another application from a C# application? I've tried
enumerating through the Process to get the window, and I've tried
using varios API calls (ShowWindow, FindWindowEx, etc...) but nothing
has worked thus far.
I'd be most grateful for any suggestions.
Thanks in advance,
Steve.