Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Set values in other program

Posted on 2006-11-29
2
Medium Priority
?
226 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:Steven
[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 1600 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:Steven
ID: 18038083
Thanks a million Idle Mind
very good and fast answer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

715 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