I'm trying to understand why a retrieved handle works and one that is put in from AutoIt v3 Windows Info does not.
The script below illustrates the issue. Any hint appreciated. It's got to be something very basic. My understanding, which may be wrong, is that AutoIt, would type a variable to the correct use. If this is wrong how do I declare a type to a handle variable type?
;trying to understand handle difference #AutoIt3Wrapper_run_debug_mode=Y ;use this to debug in console window <--- LOOK #include <MsgBoxConstants.au3> #include <File.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase ;create text file to use $fpn = _TempFile(@TempDir, "NNN", ".txt", 7) ;create unique name - already includes full path filename (fpn) into @TempDir $fn = StringRight($fpn, 14) ;get just filename _FileCreate($fpn) ;put it into @Temp directory Run("Notepad.exe /A " & $fpn) ;run Notepad WinWait($fn) ;substring match set in opt $hfn = WinGetHandle($fn) ;get handle MsgBox($MB_OK + $MB_TOPMOST, "Info", "$hfn = " & $hfn) $hmanual = InputBox("Input", "Paste in handle from AutoIt v3 Windows Help") $str = "WinGetHandle = '" & $hfn & "'" & @CRLF & "Manual Input = '" & $hmanual & "'" MsgBox($MB_OK + $MB_TOPMOST, "Info", $str) MsgBox($MB_OK + $MB_TOPMOST, "Info", "Flashing window title using handle from WinGetHandle") WinFlash($hfn) MsgBox($MB_OK + $MB_TOPMOST, "Info", "Now flashing window title using handle entered by hand") WinFlash($hmanual) MsgBox($MB_OK + $MB_TOPMOST, "PAUSE", "Program Paused Before Exit.") ;clean up WinKill($hfn) ;close notepad FileDelete($fpn) ;delete temp file Exit
I've recently be kinda forced into trying to learn OOP within AutoIt. I'm trying to convert XML into objects I guess instead of trying to parse it into arrays within arrays. An example is below:
<User> <roles> <role>Agent</role> <role>Supervisor</role> </roles> </user>
How can I convert this? Would <roles> be $User.Roles? If so would the children be $User.Roles.Role.Agent and $User.Roles.Role.Supervisor? If not, how do I reference each Object?
Any assistance would be appreciated. I tried to understand XML.au3 but I'm so confused trying to wrap my head around this.
My work has recently switched from a Win32 based application to a web based application. Thankfully there's an API for me to attach to now but I have a few questions since I'm using Objects now for some parts of my scripts...
Do I need to run ObjCreate("winhttp.winhttprequest.5.1") everytime before any object stuff or can I just run it once at the beginning of my script and reuse it? Is $oHTTP.Open("GET", <url>) followed by $oHTTP.Send() pretty much the same as INetRead and can I use them interchangeably? Do I need to somehow delete the Object after creating it at the end of my script? - Answered by Helpfile Thanks!
I am wanting to know what my CPU temp is but don't know what object to use. I don't relay know how objget works so would not know where to start. I have seen people integrate things like windows speech to text into their scripts but don't know how they know what object to use! How do I find the right object? And how dose it work?
How to work easily and fast with the oleview.exe which Displays the Object COM from Windows and other programs~