borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Emailing aform)Next Topic (Standalone .exe to kill explorer.exe) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Login program help
Poster Message
Creatica
Level: Protégé

Registered: 01-02-2007
Posts: 4

icon Login program help

Okay, I'm looking to write a program where I can enter a username/password, hit a Login button, have it run a launchpad program, press Home (to return it to the top of the list), press down arrow five times (to select the proper server), hit enter (to connect to that server), pass the username to the first field (when I connect to the server normally, the username field starts with the focus, so I don't need to do anything there), hit Tab, then pass the password to the server, and finally press enter to log on.

Currently I have two issues.  First, the first time I run the program it will shell to the launcher, but will not continue with the home/down arrows/enter.  If the launcher is open already and I run it, it passes those commands along and will connect to the server.  How can I make it connect the first time?

Second problem is that the username is not being passed to the server login screen.  I've tried various ways I can think of to do so, but it is not working.  Here is the code I have so far (up to trying to pass the username to the server)

Private Sub Command1_Click()

Shell "C:\Program Files\SAP\FrontEnd\SapGui\saplogon.exe" 'Runs launcher program
AppActivate "SAP Logon 640" 'Activates launcher
SendKeys "{HOME}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{ENTER}" 'Connects to the SAP server

Clipboard.Clear
Clipboard.SetText Me.txtUserName.Text

AppActivate "SAP" 'Activates the SAP server
SendKeys "^v" 'Supposedly sends Ctrl-V (pastes clipboard)

End Sub

Any ideas on what I'm forgetting or doing wrong?  Thanks!

20-02-2007 at 08:53 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Login program help
Previous Topic (Emailing aform)Next Topic (Standalone .exe to kill explorer.exe) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder