Recently Browsing 0 members
No registered users viewing this page.
I was exploring as I saw the below URL which reads the event logs from specific type (Application, Security, System, etc.)
So, I was in need to read a specific event id instead of the type of event, i.e. I need to read event id 1074 which lands under Security type.
Any assistance will be grateful.
Happy new year in advance!!
I have a Delphi compiled program that I use for work and I can read some logs with this function:
Func __ReadExternalListBox() Local $hListBox, $iItemCount $hListBox = ControlGetHandle("Software Setup", "", "[CLASS:TListBox; INSTANCE:1]") ConsoleWrite("$hListBox = " & $hListBox & @CRLF) $iItemCount = _GUICtrlListBox_GetCount($hListBox) For $i = $iStart To $iItemCount - 1 ConsoleWrite(GUICtrlListBox_GetText($hListBox,$i) & @CRLF) Next EndFunc ;==>__ReadExternalListBox I can find pid and full path of the process.
The problem is when I must open another process: I can't read the new ListBox because the title of the window to read is the same and the function
$hListBox = ControlGetHandle("Software Setup", "", "[CLASS:TListBox; INSTANCE:1]") return me only one handle.
With Autoinfo I can read handle: is, for this instance, 0x0001099C and is $hListBox
But I need to automize some function and I can't always change in runtime this values.
Ideas? Is there e method to read this title windows associated to a determined pid?
I don't need the handle from the pid windows application, but from its control
if I use
_WinAPI_EnumProcessWindows() the function return me window handle, not Control handle
In this case Windows Handle is 0x001007DA but I need Control Handle that is 0x0001099C
I'm trying to call WinList() with a handle. That should be possible:
But I only get back an 2d array that looks like this:
(That means no window was found.)
It's not the window or the handle. When I call other functions like WinExists() or WinGetHandle() it works.
Is it because of me, the description in the reference or because of Autoit who makes a mistake?
No, because of the rest of my program I don't want to use WinGetTitle() because the format of WinList() has to be kept. Alternatively, I could create a 2d array myself, but it should also work with WinList() ... I hope.
I having some hard times getting false-positive, probably because I am trying to execute my AutoUpdater.
Here is my code:
Global $iUpdateTimer = 0 While 1 checkUpdates(10) WEnd Func checkUpdates($iDelay = 10) $iDelay = $iDelay * 1000 * 60 If TimerDiff($iUpdateTimer) > $iDelay Then ConsoleWrite('checking for updates...' & @CRLF) $iUpdateTimer = TimerInit() If FileExists('AutoUpdater.exe') Then ShellExecuteWait('AutoUpdater.exe') ; this is the line which cause my problem EndIf EndFunc And AutoUpdater code:
#include <MsgBoxConstants.au3> #include <FileConstants.au3> Global $sExecName = 'test.exe' Global $sUpdatePath = @UserProfileDir &'\desktop\AnyAppName\update\'& $sExecName Global $sUserPath = @UserProfileDir &'\desktop\AnyAppName\'& $sExecName Global $sCopyright = 'someUniqueStringHere' If Not FileExists($sUpdatePath) Then Exit 0 If FileGetVersion($sUpdatePath, $FV_LEGALCOPYRIGHT) <> $sCopyright Then Exit 0 ; checking if we really want to update and execute the file If FileGetVersion($sUpdatePath) > FileGetVersion($sUserPath) Then $iResponse = MsgBox(BitOR($MB_YESNO, $MB_ICONQUESTION),'AnyAppName', 'There is an update available, would you like to update?') If $iResponse == $IDYES Then If ProcessExists($sExecName) Then ProcessClose($sExecName) Sleep(500) EndIf FileCopy($sUpdatePath, $sUserPath, $FC_OVERWRITE) Sleep(3000) ShellExecute($sUserPath) Exit 1 EndIf EndIf Exit 0 I am not trying to ask, why is my code is getting recognized as false-positive, because this is quite obvious, but is there any other way to get things done without running external process?