First i use VB6 and i want to make one application on which send auto button command e.g. "X" to my particular application e.g. Firefox not send button command to other application so i can use it my keyboard to on other application and also i send button like take button from text1.text and button press speed take from text2.text

Comments
Do you understand the question yourself ?

i want to make application auto press keyboard button on select application running on process(abc.exe) and also i want to click repeated very fast like in milisecond , not press button on other application

i hope now you understand

Have a look at this link with answered questions on how to interact with another program. If you know the other programs control names, no problem, otherwise you need to get the information from its cls id's, which is very advanced coding....:)

:angry:
What is this ??

ok forgate all just tell me i make two text box for input data and one command button for run script so i put "A" button on text1 and put 1000 its speed for press button (1000= 1 sec) when i press Command button my software start press "A" buttn every 1 sec and i use VB6


and it is possible to press button very fast less then 1 sec ??

Textbox and button will not handle the time, you need a timer to handle the "click" events. The timer can then be set to 10, which is 0.01 seconds)

If you say "I press cmd button, my software starts", what software starts?
Then, "put A button on text1", meaning that this is a command button that you have placed OVER text1?

Lastly, why do you want to load your app every 1 second, You will have a ton of the same thing open????

i play one game on which need press one button for hit its depend on your speed of press button so i need this make application i hope now you understand

You need to show some effort from your side as well.

Your code will look something like this -

Dim xCount As Double 'Variable to hold the time it took to press the button.

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = vbKey0 Then 'The zero key press event
    xCount = 0
    lbl2.Caption = "0" 'Label control
    tmr.Enabled = True
End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)

tmr.Enabled = False
End Sub

Private Sub tmr_Timer()

'Add a timer to your form, Enabled = False, Interval = 1 (0.001 seconds)
xCount = xCount + tmr.Interval
lbl.Caption = lbl.Caption + xCount 'Shows the total of the count after a few presses
lbl2.Caption = xCount 'Shows a once off click time
End Sub

i make in but why this not press 0 button it self ??

You need to show some effort from your side as well.

Your code will look something like this -

Dim xCount As Double 'Variable to hold the time it took to press the button.

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = vbKey0 Then 'The zero key press event
    xCount = 0
    lbl2.Caption = "0" 'Label control
    tmr.Enabled = True
End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)

tmr.Enabled = False
End Sub

Private Sub tmr_Timer()

'Add a timer to your form, Enabled = False, Interval = 1 (0.001 seconds)
xCount = xCount + tmr.Interval
lbl.Caption = lbl.Caption + xCount 'Shows the total of the count after a few presses
lbl2.Caption = xCount 'Shows a once off click time
End Sub

pls can u explain how running a code in visual basic will execute a command on another executable files without having its controls.
for example if u r playing warcraft 3 and u want by pressing ctrl + b the soldier build a house. if u dont have the controls of warcraft3 to add them and use them on ur vb project u will never be able to do so.

the code u r trying to write will execute a command button in ur own porject in vb and not remotely to another code

This article has been dead for over six months. Start a new discussion instead.