Sign in to follow this  
Followers 0
kixiopy

Autoit and C#

1 post in this topic

#1 ·  Posted (edited)

i am using autoit class 

AutoItX3Lib
AutoItX3
[ComImport, CoClass(typeof(object)), TypeIdentifier, Guid("3D54C6B8-D283-40E0-8FAB-C97F05947EE8"), CompilerGenerated]
public interface AutoItX3 : IAutoItX3
{
}

IAutoItX3

[ComImport, TypeIdentifier, CompilerGenerated, Guid("3D54C6B8-D283-40E0-8FAB-C97F05947EE8")]
public interface IAutoItX3
{
    [MethodImpl(0, MethodCodeType=MethodCodeType.Runtime)]
    void _VtblGap1_19();
    [DispId(20)]
    int ControlClick([In, MarshalAs(UnmanagedType.BStr)] string strTitle, [In, MarshalAs(UnmanagedType.BStr)] string strText, [In, MarshalAs(UnmanagedType.BStr)] string strControl, [In, MarshalAs(UnmanagedType.BStr)] string strButton = "LEFT", [In] int nNumClicks = 1, [In] int nX = -2147483647, [In] int nY = -2147483647);
    [MethodImpl(0, MethodCodeType=MethodCodeType.Runtime)]
    void _VtblGap2_14();
    [DispId(0x23)]
    int ControlSend([In, MarshalAs(UnmanagedType.BStr)] string strTitle, [In, MarshalAs(UnmanagedType.BStr)] string strText, [In, MarshalAs(UnmanagedType.BStr)] string strControl, [In, MarshalAs(UnmanagedType.BStr)] string strSendText, [In] int nMode = 0);
    [MethodImpl(0, MethodCodeType=MethodCodeType.Runtime)]
    void _VtblGap3_67();
    [DispId(0x67)]
    int WinSetState([In, MarshalAs(UnmanagedType.BStr)] string strTitle, [In, MarshalAs(UnmanagedType.BStr)] string strText, [In] int nFlags);
}

 need to send key to notepad i tried use
F5 key = Time/Date
     AutoItX3 auto = new AutoItX3();
        auto.ControlSend("[CLASS:Notepad; Title:Untitled - Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "{F5}");
     this code work when using autoit
        auto.ControlSend("Notepad", "", 0, "{F5}");
        
        Error Message
        
        Additional information: Error: Missing method 'instance int32 [WindowsApplication1] WindowsApplication1.IAutoItX3::ControlSend(string,string,string,string,int32)' from class 'System.Object'.

 

Edited by kixiopy

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