Solved

Set values in other program

Posted on 2006-11-29
2
211 Views
Last Modified: 2010-08-05
Hi experts,

I have a 3rd party program that starts up from a shortcut, the first window it’s a logging screen  now my question is it possible to write a scrip or program to run the shortcut and set the values for the user and password?. and how can it be done?

Thanks.
0
Comment
Question by:Stendor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 400 total points
ID: 18037808
Sure it's possible...the only thing in question is how much work needs to be done.

At it's simplest you could do:

    (1) Process.Start()
    (2) Process.WaitForInputIdle()
    (3) SendKeys.Send() ' UserName
    (4) SendKeys.Send() ' Tab to move to next Field
    (5) SendKeys.Send() ' Password
    (6) SendKeys.Send() ' Enter

Here is an example using NotePad:

        Dim p As Process = Process.Start("notepad")
        p.WaitForInputIdle()
        SendKeys.Send("Bond")
        SendKeys.Send("{Tab}")
        SendKeys.Send("007")
        SendKeys.Send("{Enter}")

It often gets more complicated than that though.  Sometimes you need to use APIs to look for the presence of the "login" window.  Other times you have to explicitly give a window/control focus.  I've seen some situations where SendKeys.Send() doesn't work and you have to either use APIs to simulate keyboard input directly or send the info the controls directly with SendMessage().   etc....
0
 
LVL 1

Author Comment

by:Stendor
ID: 18038083
Thanks a million Idle Mind
very good and fast answer
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question