Sign in to follow this  
Followers 0
redcrusher

VB6 and Scripting

10 posts in this topic

How do i set up a VB6 program so that i can use the autiit3 scripting in it, without having to put "au3." infront of the command?

Share this post


Link to post
Share on other sites



How do i set up a VB6 program so that i can use the autiit3 scripting in it, without having to put "au3." infront of the command?

Compile the script to an executable?

Share this post


Link to post
Share on other sites

Take a look at the AutoItX3.dll.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Take a look at the AutoItX3.dll.

Still says that i have to up smthing infromt of the command. like "oautoit."

Share this post


Link to post
Share on other sites

Still says that i have to up smthing infromt of the command. like "oautoit."

Err... yeah ... That wouldn't be a problem would it? :P

Or you could just make an autoit script like what was suggested, and call it from your vb script... or an even better idea... make the whole thing in autoit... problem solved.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

there's no way to get rid of that. you have to use the object name before the method. if you're doing a whole bunch of command you can use With

With oautoit 'the object name
.MouseMove()
.WinActivate()
.MouseClick()

Share this post


Link to post
Share on other sites

Err... yeah ... That wouldn't be a problem would it? :P

Or you could just make an autoit script like what was suggested, and call it from your vb script... or an even better idea... make the whole thing in autoit... problem solved.

see that would be no problem, but i needto have sounds recognition in the program, so even if i make it in aotuit3 i still need it to return values to the vb6 progream and then return values to the au3 program...

Share this post


Link to post
Share on other sites

there's no way to get rid of that. you have to use the object name before the method. if you're doing a whole bunch of command you can use With

With oautoit 'the object name
.MouseMove()
.WinActivate()
.MouseClick()

and i really have no problem doing that, but how do i make PixelSearch work like that?

Share this post


Link to post
Share on other sites

and i really have no problem doing that, but how do i make PixelSearch work like that?

Download AutoIt if you haven't already... do the regular install... Then go to Program Files\AutoIt3\AutoItX There is a help file right there for you to take a look at, and probably will answer most of your questions.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

How do i set up a VB6 program so that i can use the autiit3 scripting in it, without having to put "au3." infront of the command?

If you refering to the object prefix, then you could make some Subs and Functions.

Here is a VBS concept of doing it:

Dim au3, oShell, pid
Set au3 = WScript.CreateObject("AutoItX3.Control")

'Get return of Run Function

pid = Run("notepad.exe")

'Wait for the window "Untitled" to exist

If WinWaitActive("Untitled", "", 5) Then
    Send "Some text", 0
    Sleep 3000
End If

ProcessClose(pid)

WScript.Quit


Function Run(file)
    file = Chr(34) & file & Chr(34)
    Run = au3.Run(file)
End Function

Function WinWaitActive(title, text, timeout)
    WinWaitActive = au3.WinWaitActive(title, text, timeout)
End Function

Sub Send(sendtext, flag)
    au3.Send sendtext, flag
End Sub

Sub Sleep(time)
    au3.Sleep time
End Sub

Sub ProcessClose(process)
    au3.ProcessClose pid
End Sub

It may spark some ideas for you ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0