I'm using WinMenuSelectItem() successfully in the application I'm automating but i'm looking for another feature.
I use WinMenuSelectItem to Process a record.
I then need to use WinMenuSelectItem to Save the record, but I shouldn't save before the Process step above finishes (Save option is always enabled).
Sadly, the only way to know if Processing actually finished is when another menu item gets enabled (but I don't want to select that other menu item, just wait until it's enabled)
The AU3Info tool doesn't show me anything for the menu bar items so I can't use ControlCommand IsEnabled.
Anybody have other ideas?
Quick example using SciTE menu bar as they act the same, AU3Info can't see those menu items either.
;Undo in SciTE, then wait until Redo is enabled but dont click it. If WinMenuSelectItem("[CLASS:SciTEWindow]", "", "&Edit", "&Undo") Then ConsoleWrite("Undo clicked" & @CRLF) ;How to I know if "&Edit", "&Redo" is enabled? Else ConsoleWrite("Can't find Undo" & @CRLF) EndIf ;Erase this line then run/F5 to get back
UPDATED Notes: ===============================================================================
UPDATED: My main and second questions answered. Here the answers:
To add/access WinMenuSelectItem you need to [Thanks to Fernando_Marinho]: Add AutoItX.Dotnet in Manage NuGet Packages Right Click in your Project -> Add -> Reference... -> COM ( Type Libraries )than, check the option AutoItX3 1.0 Type Library using AutoItX3Lib; AutoItX3 au3 = new AutoItX3(); au3.WinMenuSelectItem("", ...) My full source code in C# exists in 11 posts in below. How to access those overloaded methods in AutoitX3 that are not accessible via above method!? Or how to fix AutoitX3 DLL Registration need in target computers without Autoit pre-installed on them!? Please check my post at 14 posts below!
=============================================================================== Original Post:
I was writing a small app in Autoit to close µTorrent app. It was working. Then I try to import AutoItX into C#, but unfortunately this method
WinMenuSelectItem Couldn't find by IntelliSense and If I typed completely it still give me this message:
Please check the image. I Google it and I found this QA at stackoverflow: Autoit error within C# application I saw they use this line:
au = new AutoItX3Lib.AutoItX3Class(); I figure it how to add 'AutoItX3Lib' to project (by adding 'AutoItX3.dll' to reference) but again! When I use this line:
var au = new AutoItX3Class(); I got this error message: Interop type 'AutoItX3Class' cannot be embedded. Use the applicable interface instead.
My system info:
Visual Studio 2017 Enterprise - v15.5.4
X64 Windows 10 Enterprise 1607
Thanks in advanced