Jump to content

Recommended Posts

Posted (edited)

i have search but i didn't find any example  : i have already incluse AutoItX3Lib for generic controls but i want use .dll developed for autoit.

please help me.

Edited by akroon
  • 2 weeks later...
  • 1 month later...
Posted (edited)

Two ways for using AutoItX3 into the vb.net

1. References browse autoitx3.dll

2. Created Object same as autoitx3 sample code.

If you wanted register autoitx3 for .net namespace, Copy and paste autoitx3;dll into System32 folder and run register dll now.

au3clip.jpg

=================================================================================

When register dll finish , will see name autoitx3 into reference Com .net

 

clipau3.jpg

===================================================================================

Download: AutoItX3DLL_Register.exe Click here

===================================================================================

Example: Reference Browse and Reference Com

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private WithEvents refBtn As System.Windows.Forms.Button
    Private WithEvents comBtn As System.Windows.Forms.Button

    Public Sub New()
        MyBase.New()
        InitializeComponent()
        refBtn = New System.Windows.Forms.Button
        comBtn = New System.Windows.Forms.Button
        refBtn.Text = "Reference Browse"
        comBtn.Text = "Reference Com"
        refBtn.Width = 120
        comBtn.Width = refBtn.Width
        refBtn.Location = New System.Drawing.Point(20, 100)
        comBtn.Location = New System.Drawing.Point(150, 100)
        refBtn.Cursor = Cursors.Hand
        comBtn.Cursor = Cursors.Hand
        Me.Controls.AddRange(New Control() {refBtn, comBtn})
    End Sub

    Private Sub refBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles refBtn.Click
        Dim oAutoIt As New AutoItX3Lib.AutoItX3
        oAutoIt.ToolTip("Hello World!")
        oAutoIt.Sleep(1000)
        oAutoIt.ToolTip("")
    End Sub

    Private Sub comBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comBtn.Click
        Dim oAutoIt As System.Object
        oAutoIt = CreateObject("AutoItX3.Control")
        oAutoIt.ToolTip("Hello World!")
        oAutoIt.Sleep(1000)
        oAutoIt.ToolTip("")
        oAutoIt = Nothing
    End Sub
End Class

=================================================================================

Sample code : Using Dll Call

Imports System.Runtime.InteropServices

Public Class Form1

    <DllImport("AutoItX3.dll", CharSet:=CharSet.Auto, EntryPoint:="AU3_ToolTip")> _
    Private Shared Function ToolTip(ByVal szTip As String, ByVal nX As Integer, ByVal nY As Integer) As Boolean
    End Function

    Public Shared Sub ToolTip(ByVal szTip As String)
        ToolTip(szTip, -2147483647, -2147483647)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ToolTip("Hello World!")
        System.Threading.Thread.Sleep(1000)
        ToolTip("")
    End Sub
End Class
Edited by Laymanball

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...