Jump to content
FrancescoDiMuro

Error 0 from _ArrayAdd()

Recommended Posts

FrancescoDiMuro

Good morning everyone :)

I'm working on a little project, and, I encountered a little strange error when I try to add some data to an array...

The code I wrote is this:

Func _WMI_Get_Win32_TemperatureProbe($blnCanUseWMI, $blnCustomArrayDisplay = False, $blnReturnEU = False)

    If $blnCanUseWMI Then
        Local $objWMI_QueryResult = $objWMI.ExecQuery("SELECT * FROM Win32_TemperatureProbe", "WQL", 32)
        If @error Then
            __ConsoleWrite("Error executing the query on Win32_TemperatureProbe class.", @error, 9999)
        Else
            Local $arrWin32_TemperatureProbe[1][3]
            _ArrayDelete($arrWin32_TemperatureProbe, 0)
            If @error Then
                __ConsoleWrite("Error deleting the 0st element $arrWin32_TemperatureProbe array.", @error, 9999)
            Else
                Local $objWMI_Variable = Null, $strWMI_QueryResult = "", $i = 0

                For $objWMI_Variable In $objWMI_QueryResult
                    $strWMI_QueryResult &= "QUERY RESULT" & "|# " & $i & "|/" & @CRLF & _
                                           "Accuracy" & "|" & $objWMI_Variable.Accuracy & "|" & "[sint32]" & @CRLF & _
                                           "Availability" & "|" & $objWMI_Variable.Availability & "|" & "[uint16]" & @CRLF & _
                                           "Caption" & "|" & $objWMI_Variable.Caption & "|" & "[string]" & @CRLF & _
                                           "ConfigManagerErrorCode" & "|" & $objWMI_Variable.ConfigManagerErrorCode & "|" & "[uint32]" & @CRLF & _
                                           "ConfigManagerUserConfig" & "|" & $objWMI_Variable.ConfigManagerUserConfig & "|" & "[boolean]" & @CRLF & _
                                           "CreationClassName" & "|" & $objWMI_Variable.CreationClassName & "|" & "[string]" & @CRLF & _
                                           "CurrentReading" & "|" & $objWMI_Variable.CurrentReading & "|" & "[sint32]" & @CRLF & _
                                           "Description" & "|" & $objWMI_Variable.Description & "|" & "[string]" & @CRLF & _
                                           "DeviceID" & "|" & $objWMI_Variable.DeviceID & "|" & "[string]" & @CRLF & _
                                           "ErrorCleared" & "|" & $objWMI_Variable.ErrorCleared & "|" & "[boolean]" & @CRLF & _
                                           "ErrorDescription" & "|" & $objWMI_Variable.ErrorDescription & "|" & "[string]" & @CRLF & _
                                           "InstallDate" & "|" & $objWMI_Variable.InstallDate & "|" & "[datetime]" & @CRLF & _
                                           "IsLinear" & "|" & $objWMI_Variable.IsLinear & "|" & "[boolean]" & @CRLF & _
                                           "LastErrorCode" & "|" & $objWMI_Variable.LastErrorCode & "|" & "[uint32]" & @CRLF & _
                                           "LowerThresholdCritical" & "|" & $objWMI_Variable.LowerThresholdCritical & "|" & "[sint32]" & @CRLF & _
                                           "LowerThresholdFatal" & "|" & $objWMI_Variable.LowerThresholdFatal & "|" & "[sint32]" & @CRLF & _
                                           "LowerThresholdNonCritical" & "|" & $objWMI_Variable.LowerThresholdNonCritical & "|" & "[sint32]" & @CRLF & _
                                           "MaxReadable" & "|" & $objWMI_Variable.MaxReadable & "|" & "[sint32]" & @CRLF & _
                                           "MinReadable" & "|" & $objWMI_Variable.MinReadable & "|" & "[sint32]" & @CRLF & _
                                           "Name" & "|" & $objWMI_Variable.Name & "|" & "[string]" & @CRLF & _
                                           "NominalReading" & "|" & $objWMI_Variable.NominalReading & "|" & "[sint32]" & @CRLF & _
                                           "NormalMax" & "|" & $objWMI_Variable.NormalMax & "|" & "[sint32]" & @CRLF & _
                                           "NormalMin" & "|" & $objWMI_Variable.NormalMin & "|" & "[sint32]" & @CRLF & _
                                           "PNPDeviceID" & "|" & $objWMI_Variable.PNPDeviceID & "|" & "[string]" & @CRLF & _
                                           "PowerManagementCapabilities" & "|" & $objWMI_Variable.PowerManagementCapabilities & "|" & "[uint16]" & @CRLF & _
                                           "PowerManagementSupported" & "|" & $objWMI_Variable.PowerManagementSupported & "|" & "[boolean]" & @CRLF & _
                                           "Resolution" & "|" & $objWMI_Variable.Resolution & "|" & "[uint32]" & @CRLF & _
                                           "Status" & "|" & $objWMI_Variable.Status & "|" & "[string]" & @CRLF & _
                                           "StatusInfo" & "|" & $objWMI_Variable.StatusInfo & "|" & "[uint16]" & @CRLF & _
                                           "SystemCreationClassName" & "|" & $objWMI_Variable.SystemCreationClassName & "|" & "[string]" & @CRLF & _
                                           "SystemName" & "|" & $objWMI_Variable.SystemName & "|" & "[string]" & @CRLF & _
                                           "Tolerance" & "|" & $objWMI_Variable.Tolerance & "|" & "[sint32]" & @CRLF & _
                                           "UpperThresholdCritical" & "|" & $objWMI_Variable.UpperThresholdCritical & "|" & "[sint32]" & @CRLF & _
                                           "UpperThresholdFatal" & "|" & $objWMI_Variable.UpperThresholdFatal & "|" & "[sint32]" & @CRLF & _
                                           "UpperThresholdNonCritical" & "|" & $objWMI_Variable.UpperThresholdNonCritical & "|" & "[sint32]"
                    $i+=1
                Next
                ConsoleWrite($strWMI_QueryResult & @CRLF)
                _ArrayAdd($arrWin32_TemperatureProbe, $strWMI_QueryResult) ; I'll wait for an answer... See you later :)
                If @error Then
                    __ConsoleWrite("Error inserting item #" & $i & " in the $arrWin32_TemperatureProbe array.", @error, 9999)
                Else
                    If $blnCustomArrayDisplay Then
                        _ArrayDisplay($arrWin32_TemperatureProbe, "Win32_TemperatureProbe:", "", 64 + 32 + 4, "|", "VARIABLE NAME|ACTUAL VALUE|ENGINEERING UNIT", 350, 0xD3D3D3)
                        If @error Then
                            __ConsoleWrite("Error displaying the $arrWin32_TemperatureProbe array.", @error, 9999)
                        EndIf
                    EndIf

                    If $blnReturnEU = False Then
                        _ArrayColDelete($arrWin32_TemperatureProbe, 2)
                        If @error Then
                            __ConsoleWrite("Error deleting the column #2 of $arrWin32_TemperatureProbe array.")
                        EndIf
                    EndIf

                    If IsArray($arrWin32_TemperatureProbe) Then
                        Return $arrWin32_TemperatureProbe
                    Else
                        Return False
                    EndIf
                EndIf
            EndIf
        EndIf
    EndIf

EndFunc

And I get this error ( undocumented in the Help File on _ArrayAdd() function ):

[15/09/2017 10:24:46] : Error inserting item #4 in the $arrWin32_TemperatureProbe array. > Error: 0

Adding a ConsoleWrite() before the _ArrayAdd() function, I can see the content of $strWMI_QueryResult, and, here it is:

QUERY RESULT|# 0|/
Accuracy|32768|[sint32]
Availability||[uint16]
Caption|Sensore numerico|[string]
ConfigManagerErrorCode||[uint32]
ConfigManagerUserConfig||[boolean]
CreationClassName|Win32_TemperatureProbe|[string]
CurrentReading||[sint32]
Description|CPU Thermal Probe|[string]
DeviceID|root\cimv2 0|[string]
ErrorCleared||[boolean]
ErrorDescription||[string]
InstallDate||[datetime]
IsLinear||[boolean]
LastErrorCode||[uint32]
LowerThresholdCritical||[sint32]
LowerThresholdFatal||[sint32]
LowerThresholdNonCritical||[sint32]
MaxReadable|1270|[sint32]
MinReadable|64266|[sint32]
Name|Sensore numerico|[string]
NominalReading||[sint32]
NormalMax||[sint32]
NormalMin||[sint32]
PNPDeviceID||[string]
PowerManagementCapabilities||[uint16]
PowerManagementSupported||[boolean]
Resolution|1000|[uint32]
Status|Unknown|[string]
StatusInfo||[uint16]
SystemCreationClassName|Win32_ComputerSystem|[string]
SystemName|DESKTOP-25LFPVU|[string]
Tolerance|32768|[sint32]
UpperThresholdCritical||[sint32]
UpperThresholdFatal||[sint32]
UpperThresholdNonCritical||[sint32]QUERY RESULT|# 1|/
Accuracy|32768|[sint32]
Availability||[uint16]
Caption|Sensore numerico|[string]
ConfigManagerErrorCode||[uint32]
ConfigManagerUserConfig||[boolean]
CreationClassName|Win32_TemperatureProbe|[string]
CurrentReading||[sint32]
Description|True Ambient Thermal Probe|[string]
DeviceID|root\cimv2 1|[string]
ErrorCleared||[boolean]
ErrorDescription||[string]
InstallDate||[datetime]
IsLinear||[boolean]
LastErrorCode||[uint32]
LowerThresholdCritical||[sint32]
LowerThresholdFatal||[sint32]
LowerThresholdNonCritical||[sint32]
MaxReadable|1270|[sint32]
MinReadable|64266|[sint32]
Name|Sensore numerico|[string]
NominalReading||[sint32]
NormalMax||[sint32]
NormalMin||[sint32]
PNPDeviceID||[string]
PowerManagementCapabilities||[uint16]
PowerManagementSupported||[boolean]
Resolution|1000|[uint32]
Status|Unknown|[string]
StatusInfo||[uint16]
SystemCreationClassName|Win32_ComputerSystem|[string]
SystemName|DESKTOP-25LFPVU|[string]
Tolerance|32768|[sint32]
UpperThresholdCritical||[sint32]
UpperThresholdFatal||[sint32]
UpperThresholdNonCritical||[sint32]QUERY RESULT|# 2|/
Accuracy|32768|[sint32]
Availability||[uint16]
Caption|Sensore numerico|[string]
ConfigManagerErrorCode||[uint32]
ConfigManagerUserConfig||[boolean]
CreationClassName|Win32_TemperatureProbe|[string]
CurrentReading||[sint32]
Description|Memory Module Thermal Probe|[string]
DeviceID|root\cimv2 2|[string]
ErrorCleared||[boolean]
ErrorDescription||[string]
InstallDate||[datetime]
IsLinear||[boolean]
LastErrorCode||[uint32]
LowerThresholdCritical||[sint32]
LowerThresholdFatal||[sint32]
LowerThresholdNonCritical||[sint32]
MaxReadable|1270|[sint32]
MinReadable|64266|[sint32]
Name|Sensore numerico|[string]
NominalReading||[sint32]
NormalMax||[sint32]
NormalMin||[sint32]
PNPDeviceID||[string]
PowerManagementCapabilities||[uint16]
PowerManagementSupported||[boolean]
Resolution|1000|[uint32]
Status|Unknown|[string]
StatusInfo||[uint16]
SystemCreationClassName|Win32_ComputerSystem|[string]
SystemName|DESKTOP-25LFPVU|[string]
Tolerance|32768|[sint32]
UpperThresholdCritical||[sint32]
UpperThresholdFatal||[sint32]
UpperThresholdNonCritical||[sint32]QUERY RESULT|# 3|/
Accuracy|32768|[sint32]
Availability||[uint16]
Caption|Sensore numerico|[string]
ConfigManagerErrorCode||[uint32]
ConfigManagerUserConfig||[boolean]
CreationClassName|Win32_TemperatureProbe|[string]
CurrentReading||[sint32]
Description|Video Card Thermal Probe|[string]
DeviceID|root\cimv2 3|[string]
ErrorCleared||[boolean]
ErrorDescription||[string]
InstallDate||[datetime]
IsLinear||[boolean]
LastErrorCode||[uint32]
LowerThresholdCritical||[sint32]
LowerThresholdFatal||[sint32]
LowerThresholdNonCritical||[sint32]
MaxReadable|1270|[sint32]
MinReadable|64266|[sint32]
Name|Sensore numerico|[string]
NominalReading||[sint32]
NormalMax||[sint32]
NormalMin||[sint32]
PNPDeviceID||[string]
PowerManagementCapabilities||[uint16]
PowerManagementSupported||[boolean]
Resolution|1000|[uint32]
Status|Unknown|[string]
StatusInfo||[uint16]
SystemCreationClassName|Win32_ComputerSystem|[string]
SystemName|DESKTOP-25LFPVU|[string]
Tolerance|32768|[sint32]
UpperThresholdCritical||[sint32]
UpperThresholdFatal||[sint32]
UpperThresholdNonCritical||[sint32]

 

Could please anyone help me out? 

Thanks in advance :)

Francesco

Edited by FrancescoDiMuro
Wrong Code!

Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

ALWAYS GOOD TO READ:

In case I am violating some pseudo Forum rule, or I am doing something wrong, I want let you know that I'm not doing this on purpose, and for this, I kindly ask you to send me a private message about the "bad content" I posted, in order to edit/remove it, and to not be warned wrongly.
Thanks in advance.

 

Share this post


Link to post
Share on other sites
SlackerAl

The code you've pasted does not contain the line the error occurs in (no mention of $arrWin32_TemperatureProbe in your function).

I suggest the first step to solving this is to analyse all your variables and write a short replicator of your problem.


Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Share this post


Link to post
Share on other sites
FrancescoDiMuro

Hi @SlackerAl!

I updated the code! I attached wrong code before, sorry! :)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

ALWAYS GOOD TO READ:

In case I am violating some pseudo Forum rule, or I am doing something wrong, I want let you know that I'm not doing this on purpose, and for this, I kindly ask you to send me a private message about the "bad content" I posted, in order to edit/remove it, and to not be warned wrongly.
Thanks in advance.

 

Share this post


Link to post
Share on other sites
SlackerAl

Can I refer you to my second comment? :-)

The only other help I can be is it seems very likely to me that your query data is not appropriately formatted to be added to an array e.g. \ ' " data in it perhaps?


Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Share this post


Link to post
Share on other sites
FrancescoDiMuro

Why ' , \ or " should affect the insert into the array? :)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

ALWAYS GOOD TO READ:

In case I am violating some pseudo Forum rule, or I am doing something wrong, I want let you know that I'm not doing this on purpose, and for this, I kindly ask you to send me a private message about the "bad content" I posted, in order to edit/remove it, and to not be warned wrongly.
Thanks in advance.

 

Share this post


Link to post
Share on other sites
BrewManNH

Try changing these lines to this.

;` from this
_ArrayAdd($arrWin32_TemperatureProbe, $strWMI_QueryResult) ; I'll wait for an answer... See you later :)
If @error Then
    __ConsoleWrite("Error inserting item #" & $i & " in the $arrWin32_TemperatureProbe array.", @error, 9999)

;` to this
_ArrayAdd($arrWin32_TemperatureProbe, $strWMI_QueryResult) ; I'll wait for an answer... See you later :)
If @error Then
    $error = @error
    __ConsoleWrite("Error inserting item #" & $i & " in the $arrWin32_TemperatureProbe array.", $error, 9999)

See if the error message is different, and then see what it refers to.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@BrewManNH

Thank you for replying :)

No changes at the error code by the way... :)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

ALWAYS GOOD TO READ:

In case I am violating some pseudo Forum rule, or I am doing something wrong, I want let you know that I'm not doing this on purpose, and for this, I kindly ask you to send me a private message about the "bad content" I posted, in order to edit/remove it, and to not be warned wrongly.
Thanks in advance.

 

Share this post


Link to post
Share on other sites
FrancescoDiMuro

Bump :)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

ALWAYS GOOD TO READ:

In case I am violating some pseudo Forum rule, or I am doing something wrong, I want let you know that I'm not doing this on purpose, and for this, I kindly ask you to send me a private message about the "bad content" I posted, in order to edit/remove it, and to not be warned wrongly.
Thanks in advance.

 

Share this post


Link to post
Share on other sites
BrewManNH

Can you post a working example script so we can test this?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • Gowrisankar
      By Gowrisankar
      Dear members, 
      I am working on a project where, emails from outlook are to be read and moved to various folders within the mailbox, based on the content of the emails.
      I used the below code for moving mails. It works fine when I run it against individual mail ids. But when I run it on Shared mailbox, the mails are not moved to respective folders.
      _OL_ItemMove($oOutlook, $sEntryId, Default, $sDestinationFolder) The value of $sEntryId is saved in an excel report initially. The current process reads the $sEntryId from the excel and passes it to "_OL_ItemMove" statement.
      Requesting the guidance of the forum members in this issue.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I am working with Word UDF ( thanks @water! ), and, especially, with the function _Word_DocFindReplace().
      The replace does work everywhere in the document, but, it does not work in Headers or Footers.
      Am I missing something or am I forced to use the code below?
      I have already looked in the Help file ( about _Word_DocFindReplace() ), but there are no mentions about replace text in Headers/Footers.
      Sub FindAndReplaceFirstStoryOfEachType() Dim rngStory As Range For Each rngStory In ActiveDocument.StoryRanges With rngStory.Find .Text = "find text" .Replacement.Text = "I'm found .Wrap = wdFindContinue .Execute Replace:=wdReplaceAll End With Next rngStory End Sub Thanks everyone in advance


      Best Regards.
    • ScriptJunky
      By ScriptJunky
      I noticed a lack of a constants file for _WinAPI_GetSystemMetrics() so I made this for anyone who wants to add it to their library. Enjoy!  (file attached below)
      #include-once ; #INDEX# ======================================================================================================================= ; Title .........: WinAPI GetSystemMetrics Constants ; AutoIt Version : 3.3.14.5 ; Language ......: English ; Description ...: Constants for _WinAPI_GetSystemMetrics(). ; Author(s) .....: ScriptJunky ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== ; _WinAPI_GetSystemMetrics() Global Const $ARRANGE = 56 Global Const $CLEANBOOT = 67 Global Const $CMONITORS = 80 Global Const $CMOUSEBUTTONS = 43 Global Const $CONVERTIBLESLATEMODE = 0x2003 Global Const $CXBORDER = 5 Global Const $CXCURSOR = 13 Global Const $CXDLGFRAME = 7 Global Const $CXDOUBLECLK = 36 Global Const $CXDRAG = 68 Global Const $CXEDGE = 45 Global Const $CXFIXEDFRAME = 7 Global Const $CXFOCUSBORDER = 83 Global Const $CXFRAME = 32 Global Const $CXFULLSCREEN = 16 Global Const $CXHSCROLL = 21 Global Const $CXHTHUMB = 10 Global Const $CXICON = 11 Global Const $CXICONSPACING = 38 Global Const $CXMAXIMIZED = 61 Global Const $CXMAXTRACK = 59 Global Const $CXMENUCHECK = 71 Global Const $CXMENUSIZE = 54 Global Const $CXMIN = 28 Global Const $CXMINIMIZED = 57 Global Const $CXMINSPACING = 47 Global Const $CXMINTRACK = 34 Global Const $CXPADDEDBORDER = 92 Global Const $CXSCREEN = 0 Global Const $CXSIZE = 30 Global Const $CXSIZEFRAME = 32 Global Const $CXSMICON = 49 Global Const $CXSMSIZE = 52 Global Const $CXVIRTUALSCREEN = 78 Global Const $CXVSCROLL = 2 Global Const $CYBORDER = 6 Global Const $CYCAPTION = 4 Global Const $CYCURSOR = 14 Global Const $CYDLGFRAME = 8 Global Const $CYDOUBLECLK = 37 Global Const $CYDRAG = 69 Global Const $CYEDGE = 46 Global Const $CYFIXEDFRAME = 8 Global Const $CYFOCUSBORDER = 84 Global Const $CYFRAME = 33 Global Const $CYFULLSCREEN = 17 Global Const $CYHSCROLL = 3 Global Const $CYICON = 12 Global Const $CYICONSPACING = 39 Global Const $CYKANJIWINDOW = 18 Global Const $CYMAXIMIZED = 62 Global Const $CYMAXTRACK = 60 Global Const $CYMENU = 15 Global Const $CYMENUCHECK = 72 Global Const $CYMENUSIZE = 55 Global Const $CYMIN = 29 Global Const $CYMINIMIZED = 58 Global Const $CYMINSPACING = 48 Global Const $CYMINTRACK = 35 Global Const $CYSCREEN = 1 Global Const $CYSIZE = 31 Global Const $CYSIZEFRAME = 33 Global Const $CYSMCAPTION = 51 Global Const $CYSMICON = 50 Global Const $CYSMSIZE = 53 Global Const $CYVIRTUALSCREEN = 79 Global Const $CYVSCROLL = 20 Global Const $CYVTHUMB = 9 Global Const $DBCSENABLED = 42 Global Const $DEBUG = 22 Global Const $DIGITIZER = 94 Global Const $IMMENABLED = 82 Global Const $MAXIMUMTOUCHES = 95 Global Const $MEDIACENTER = 87 Global Const $MENUDROPALIGNMENT = 40 Global Const $MIDEASTENABLED = 74 Global Const $MOUSEPRESENT = 19 Global Const $MOUSEHORIZONTALWHEELPRESENT = 91 Global Const $MOUSEWHEELPRESENT = 75 Global Const $NETWORK = 63 Global Const $PENWINDOWS = 41 Global Const $REMOTECONTROL = 0x2001 Global Const $REMOTESESSION = 0x1000 Global Const $SAMEDISPLAYFORMAT = 81 Global Const $SECURE = 44 Global Const $SERVERR = 289 Global Const $SHOWSOUNDS = 70 Global Const $SHUTTINGDOWN = 0x2000 Global Const $SLOWMACHINE = 73 Global Const $STARTER = 88 Global Const $SWAPBUTTON = 23 Global Const $TABLETPC = 86 Global Const $XVIRTUALSCREEN = 76 Global Const $YVIRTUALSCREEN = 77  
      WinAPISystemMetricsConstants.au3
    • rcmaehl
      By rcmaehl
      A UDF with Extended Functions for Window Management
       
      Notes:
      Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
       
      Potential Uses:
      Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
       
      Functions:
      _WinGetClassList
      _WinGetClassNNList
      _WindowGetHandleList
      _WindowGetHandleListFromPos
       
      Download: 
      WindowEx.zip  (v0.4)
       
      Changelog:
      10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x][1] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
      None reported To Do:
      To Be Decided. Opinions welcome! Upcoming Changes:
      To Be Decided.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone

      I was playing a little bit with "Screen Capture" UDF, and I was trying to make a "Window" capture, but, since I made a GUI which through I fire the event "Capture", my GUI is captured as well, and I don't want to
      This is the line of code that makes the capture:
       
      _ScreenCapture_CaptureWnd($strScreenCaptureFileName, $objActiveWindow, 0, 0, -1, -1, False) And these are the lines of code which select the "active" window:
       
      Local $objCurrentWindow = 9999 If _IsPressed("01") Then $objCurrentWindow = WinGetHandle("[ACTIVE]") If $objCurrentWindow <> $objMyGUI Then $objActiveWindow = $objCurrentWindow EndIf EndIf Sorry If I made stupid mistakes
      Thanks in advance.

      Francesco
×