Hi JohnOne,
thanks for your reply.
Procmon indeed asks for admin.
In this small example #RequireAdmin fixed the issue:
#RequireAdmin
$ProcMonWindowHandle = WinWait("[CLASS:PROCMON_WINDOW_CLASS]","",3)
If $ProcMonWindowHandle = 0 Then MsgBox(1, "Error", "Error")
WinActivate ($ProcMonWindowHandle)
Sleep (1000)
WinSetState ( $ProcMonWindowHandle, "", @SW_HIDE )
Sleep (2000)
WinSetState ( $ProcMonWindowHandle, "", @SW_SHOW )
My initial script which runs procmon had the following wrapper directive:
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
I thought this was enough to carry the permission level to the procmon child process.
When I add #RequireAdmin, I'm able to use WinSetState correctly.
But the initial @SW_HIDE command still doesn't work:
Run("procmon.exe /Nofilter /accepteula /Quiet /Minimized /BackingFile ProcmonTrace.PML", "", @SW_HIDE)