Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i try to send some orders to program("avg antivirus")to start "Scan"
this code
VB.NET
Imports System.Threading
Public Class Form1
    Dim a As New Process

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        a.StartInfo.FileName = "C:\Program Files\AVG\AVG2015\avgui"
        Me.MinimizeBox = True
        a.Start()
        Thread.Sleep(5000)
        SendKeys.SendWait("{TAB}")
        Thread.Sleep(200)
        SendKeys.SendWait("{TAB}")
        Thread.Sleep(200)
        SendKeys.SendWait("{TAB}")
        Thread.Sleep(200)
        SendKeys.SendWait("{TAB}")
        Thread.Sleep(200)
        SendKeys.SendWait("{TAB}")
        Thread.Sleep(200)
        SendKeys.SendWait("{ENTER}")
    End Sub

the problem is (to send orders to "avg antivirus" , avg program must be always on top )
i hope anyone helps me to solve this problem
Posted
Comments
Maciej Los 1-Jun-15 15:33pm    
Off-topic!
Member 11731343 1-Jun-15 15:48pm    
I'm really sorry
[no name] 1-Jun-15 15:41pm    
I don't think this is the best way to go about this. Is there some reason that you can't use an already existing solution such as AutoIT?
Member 11731343 1-Jun-15 15:46pm    
I am beginner in programming ,so can u help me and explain how can i do it?
[no name] 1-Jun-15 15:50pm    
How to do something the wrong way? If you are beginner the you probably do not want to mess with this. Try something that doesn't require advanced programming techniques.

1 solution

Wrong approach! Using such of "programming-practice" is redundant!

Rather than it, look for avg antivirus command line parameters[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Jun-15 16:13pm    
5ed. Perhaps some further explanations could be useful. This is really an attempt for a big abuse of technology, as nearly always with SendKey (can SendKey really be useful? :-(...
—SA
Maciej Los 1-Jun-15 16:26pm    
Thank you, Sergey ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900