Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Here at work, we are trying to automate software installations. We presently use Winbatch, but I want to use Visual Basic.net.

 

I just took my first course in VB.net and I really like it.

 

Can someone help me figure out how to send key strokes or send messages to screens that have input focus? This would enable me to automate some software installs that we received from vendors. Then we would not have to install them one at a time by hand. thanks in advance for your help.

Posted

have a search for sendKeys, this will show you how the function works. there are some really good examples of how to use the different things in the sendkeys function.

 

Good luck with it.

Chris
Posted

ok, here is the dead end of what u need:

1st declare this winapi function with constants in the header of the form as an example:

Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Public Const KEYEVENTF_EXTENDEDKEY = &H1

Public Const KEYEVENTF_KEYUP = &H2

 

then whenever u want u can use it to automate keyboard strokes

like

keybd_event(CByte(System.Windows.Forms.Keys.A), 0, 0, 0)

keybd_event(CByte(System.Windows.Forms.Keys.B), 0, 0, 0)

keybd_event(CByte(System.Windows.Forms.Keys.E), 0, 0, 0)

to automate A, B, E

Posted
It will take you ages to come up with something with 10% of the stuff that winbatch can do. We are in the same boat, but have 4 developers experienced in .net, but still use winbatch as it saves a shedload of work. If your doing it for other reasons (like to learn) then good luck, but from a business view its a lot of output for not much input, if you get my meaning.
Posted
OO I forgot to add. The best way to start is to get youself a programmng with API book (dan applemans book is a must) which has a complete section on controlling windows applications via the API.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...