Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does VB 6 not support SendKeysWait()

Status
Not open for further replies.

DaTommyboY

Programmer
Feb 10, 2004
40
NL
Hello peoples,
I am working on a peace of code to automaticly startup a 3D drawing program, start a new drawing and past automatisch about 100 curves. You probebly see my problem, 100 curves is LOT of work.
My idea was to use SendKeys(), however I have to wait till the action of my Keys are actualy carryed out. Therefore is the SendKeysWait() function, according to the maniual. However, my VB program does not support that function!!! Any help would be nice.
My code
on a module
Code:
Option Explicit

Public ReturnValue As String
Public QQ As Integer
Public RR, TT As String
Public SS, UU As Integer

on a form
Code:
Private Sub Command1_Click()

SS = Val(Text2.Text)
TT = 1 'naam curve

ReturnValue = Shell("c:\program files\solidworks\sldworks.exe", 1) ' Run Solid Works
Debug.Print ReturnValue

AppActivate "Solidworks"    ' Activate Solid works.

'AppActivate ReturnValue    ' Activate Solid works.
Debug.Print ReturnValue

SendKeys "(^N)", True 'aanmaken nieuwe tekening

SendKeys "~", True 'enter doorsturen om nieuwe tekening te bevestigen

For UU = 1 To SS 'times to repeat(number of curves to insert)

SendKeys "%+I", True 'pull down INSERT menu openen

For QQ = 1 To 3
    SendKeys "{down}", True '3 x pijl omlaag
Next QQ

SendKeys "{right}", True '1 x pijl rechts

For QQ = 1 To 5
    SendKeys "{down}", True '5 x pijl omlaag
Next QQ

SendKeys "~", True

For QQ = 1 To 2
    SendKeys "{tab}", True '2 x tab
Next QQ

SendKeys "~", True

RR = Text1.Text + "\" + TT + ".sldcrv"

TT = TT + 1

SendKeys TT, True 'naam en pad doorsturen van in te voegen curve

SendKeys "~", True

SendKeys "{tab}", True '1 x tab

SendKeys "~", True

Next UU


MsgBox ("Inserting the curves in done, nice!!")

End Sub

PS i use a dirlistbox to determin in with folder the curves are saved!!

****** Tractor Pulling ******
The most powerfull motorsport
in the world!!!
 
Hi Vladk,
Iam not very handy with VB, so I have read the manual about Do Events, but without I succes.
Can you help me anything further?? With some examples or more info

Thanks in advance,

Tom

****** Tractor Pulling ******
The most powerfull motorsport
in the world!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top