Tyshan Posted March 16, 2019 Posted March 16, 2019 Hi, I use AutoIT to run Wireshark, then Wireshark will record some data and export the data into csv file. But how can I use AutoIT to trigger a menu WinMenuSelectItem like File(F) from Wireshark? What is wrong with the codes? Codes #include <GUIConstantsEx.au3> #include <GuiToolbar.au3> #include <MsgBoxConstants.au3> #include <GuiMenu.au3> Example() Func Example() Local $wiresharkPath="C:\Program Files\Wireshark\Wireshark.exe" Run($wiresharkPath) Sleep(5000) WinWaitActive("[CLASS:Qt5QWindowIcon]") $hWnd = WinGetHandle("[CLASS:Qt5QWindowIcon]") $hMain = _GUICtrlMenu_GetMenu($hWnd) $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) WinMenuSelectItem("[CLASS:Qt5QWindowIcon]", "", "&文件") Sleep(2000) EndFunc
Tyshan Posted March 16, 2019 Author Posted March 16, 2019 It seems that this line codes don't work as expected WinWaitActive("[CLASS:Qt5QWindowIcon]") I use Notepad for a test, it worked with WinMenuSelectItem("[CLASS:Notepad]", "", "&文件") Pls give me more clue. Thanks in advance
rm4453 Posted March 16, 2019 Posted March 16, 2019 9 minutes ago, Tyshan said: It seems that this line codes don't work as expected WinWaitActive("[CLASS:Qt5QWindowIcon]") I use Notepad for a test, it worked with WinMenuSelectItem("[CLASS:Notepad]", "", "&文件") Pls give me more clue. Thanks in advance controlsend F ?
Earthshine Posted March 16, 2019 Posted March 16, 2019 Going to need UIAutomation. Qt control won’t respond to standard Autoit My resources are limited. You must ask the right questions
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now