Jump to content

Recommended Posts

Posted

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 

捕获.PNG

Posted

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

Posted
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 ?

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...