Jump to content
Sign in to follow this  

how to use include in C# -visual studio

Recommended Posts


Hi ,

I want to use Autoit in C# so after adding reference and using below code ,I am able to invoke my application in C# using Visual Studio2010

using System;
using System.Text;
using AutoItX3Lib;
using System.Runtime.InteropServices;
namespace useAutoItCode
class Program
public static void Main(string[] args)
AutoItX3Lib.AutoItX3 autoit = new AutoItX3Lib.AutoItX3();

I want to access Menu, tree view option of my application hence by referring to below code it is working in AUTOIT editor.

I am new to Autoit and programming and want to know how to use directives #include <GuiTreeView.au3> and access menu,tree view objects in C#. Could you please advice? Thank you

#include <GUIConstantsEx.au3>
#include <GuiTreeView.au3>
#include <WindowsConstants.au3>


Func Example()
    Local $aidItem[10], $iRand, $idTreeView

    GUICreate("TreeView Select Item", 400, 300)

    $idTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)

    For $x = 0 To 9
        $aidItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x), $idTreeView)
        For $y = 1 To 3
            GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Child", $y), $aidItem[$x])

    $iRand = Random(0, 9, 1)
    _GUICtrlTreeView_SelectItem($idTreeView, $aidItem[$iRand])

    ; Loop until the user exits.
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example








  • Like 1

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.