Recently Browsing 0 members
No registered users viewing this page.
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.
Hi all, I wasnt active in this Forum forum for Years. 😅
Since I need something with Json in AutoIt i write a little UDF to save a variable to file to read it with another language - and back. After a while until my other script grows i thought - lets integrate all variables wich is possible, because i want have arrays to.
This is my first public UDF in Autoit - normaly my AutoIt scripts are quick an dirty.... - like the examples for this udf. - someone want to write nice examples?
I tried to write this UDF properly, cared for processing speed, low mem consumption as possible, a short code, and a high usability without beeing very familiar with arrays.
What is it for? - convert nearly all types of variables to a json string for saving it in a file or to an ini. Read it back in to a same formated variable and preserv variable types. All array types are supported with nested arrays, the only restriction is ram and array/stringsize - and time if the array is very big. You can use Filters for variable types and some other options.
If anyone found a bug or any suggestions, please post it.
get Json.au3 from here Json.au3
I'm trying to fill a ListView with all normal viewable windows to act with them.
First I tried with WinList:
Local $aWinList = WinList("[REGEXPTITLE:(?i)(.+)]") Local $aTmp, $iID ;~ _ArrayDisplay($aWinList) For $i = $aWinList To 1 Step -1 ; going backwards not disturbing the index while cycling through and deleting some If StringStripWS( $aWinList[$i], 3) == "" Or _ Not BitAND(WinGetState($aWinList[$i]), $WIN_STATE_VISIBLE) Or _ BitAND(WinGetState($aWinList[$i]), $WIN_STATE_MINIMIZED ) Then _ArrayDelete($aWinList, $i) Else ; Window has a Title and is "visible" $aTmp = WinGetPos($aWinList[$i]) If $aTmp < -1000 Or $aTmp < -1000 Then ; Window is minimized or tray icon _ArrayDelete($aWinList, $i) EndIf EndIf Next $aWinList = UBound($aWinList)-1 ; getting actual # of windows ; Each row is now [ID]=> [Title], [hWnd] But it keeps getting Windows which are definitely not there at least not visible:
Those windows "Rechner", "Einstellungen", "Netflix", "Microsoft Store", ... are not there!?!
It should list only the first three windows, which are real.
I even tried it with _WinAPI_ UDF:
$hWnd = _WinAPI_GetForegroundWindow() ; Add items _GUICtrlListView_BeginUpdate($idListview) If $hWnd <> 0 Then $iI = 0 Do If _WinAPI_IsWindow($hWnd) And _WinAPI_IsWindowVisible Then _GUICtrlListView_AddItem($idListview, WinGetTitle($hWnd)) _GUICtrlListView_AddSubItem($idListview, $iI, $hWnd, 1) $iI += 1 $hWnd = _WinAPI_GetWindow($hWnd, $GW_HWNDNEXT) EndIf Until $hWnd = 0 EndIf But it is the same...
How can i distinguish those invisible windows from normal ones?
PS: I'm using Windows 10, maybe it is important to know?
I am currently using Autoit's "WinList" function in an Autoit script, I fully understand it.
Autoit provides a nice Library for Word VBA so that Some of Autoit's functions can be used within a MSWord VBA script, some of which I am using.
I have a use for Autoit's "WinList" function which has been provided by AutoIt in their Library for MSWord VBA scripting. The WinList function Creates an array when run. MSWord VBA does not seem to allow this. To create an array in VBA you have to first DIM it, and this does not seem to work for the WinList function.
Dim AutoIt As New AutoItX3Lib.AutoItX3
MyArray= Autoit(WinList) produces an error, whether I dim the array or not.
It seems that AutoIt has provided a function for VBA that cant be used ??
Can someone figure out a way to use WinList within Word VBA?