Jump to content

Recommended Posts

Posted

Under win11 running the beta version it is OK for me

Just explain what you are doing post a repro script

Posted (edited)

 

@jpm maybe the same way like here:

https://www.autoitscript.com/trac/autoit/ticket/3849#comment:2

@rikthhpgf2005 please use this script to post here result as text

; Dec, Int, Number Constants
Global Const $NUMBER_AUTO = 0
Global Const $NUMBER_32BIT = 1
Global Const $NUMBER_64BIT = 2
Global Const $NUMBER_DOUBLE = 3

Global Const $tagOSVERSIONINFO = 'struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct'

ConsoleWrite('Windows version: ' & _WinAPI_GetVersion() & @CRLF)

Func _WinAPI_GetVersion()
        Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
        DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))

        Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
        If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0)

        MsgBox(0, "OSVERSIONINFO", "MajorVersion = " & DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _
                        "MinorVersion = " & DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _
                        "BuildNumber = " & DllStructGetData($tOSVI, "BuildNumber"))

        Return Number(DllStructGetData($tOSVI, "MajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE)
EndFunc   ;==>_WinAPI_GetVersion

or even this one:

#AutoIt3Wrapper_Change2CUI=y
; Dec, Int, Number Constants
Global Const $NUMBER_AUTO = 0
Global Const $NUMBER_32BIT = 1
Global Const $NUMBER_64BIT = 2
Global Const $NUMBER_DOUBLE = 3

Global Const $tagOSVERSIONINFO = "struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct"

Global $sInformation = _
                "AutoIt version: " & @AutoItVersion & @CRLF & _
                "Windows version: " & _WinAPI_GetVersion() & @CRLF & "  Build: " & @extended & @CRLF & _
                "@OSVersion: " & @OSVersion & @CRLF & _
                "@OSType: " & @OSType & @CRLF & _
                ""

ConsoleWrite($sInformation & @CRLF)
ClipPut($sInformation)

Func _WinAPI_GetVersion()
        Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
        DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))

        Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
        If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0)

        MsgBox(0, "OSVERSIONINFO", "MajorVersion = " & DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _
                        "MinorVersion = " & DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _
                        "BuildNumber = " & DllStructGetData($tOSVI, "BuildNumber"))

        Return SetError(0, Number(DllStructGetData($tOSVI, "BuildNumber")), Number(DllStructGetData($tOSVI, "MajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE))
EndFunc   ;==>_WinAPI_GetVersion

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
3 hours ago, mLipok said:

please use this script to post here result as text

Windows Server 2025 Standard
24H2 - 26100.1742
===========================
AutoIt version: 3.3.17.1
Windows version: 10  -   Build: 26100
@OSVersion: WIN_2022
@OSType: WIN32_NT
===========================
Windows Server 2025 Standard
24H2 - 26100.4349
===========================
AutoIt version: 3.3.17.1
Windows version: 10  -   Build: 26100
@OSVersion: WIN_2022
@OSType: WIN32_NT
===========================

Installed Server 2025 in VMs. These are the results of the 1st ISO and the updated to "June 2025"

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted (edited)
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=Beta
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Dec, Int, Number Constants
Global Const $NUMBER_AUTO = 0
Global Const $NUMBER_32BIT = 1
Global Const $NUMBER_64BIT = 2
Global Const $NUMBER_DOUBLE = 3

;~ Global Const $tagOSVERSIONINFO = "struct;dword dwOSVersionInfoSize;dword dwMajorVersion;dword dwMinorVersion;" & _
;~ "dword dwBuildNumber;dword dwPlatformId;wchar szCSDVersion[128];endstruct"

Global Const $tagOSVERSIONINFO = "struct;DWORD dwOSVersionInfoSize;DWORD dwMajorVersion;DWORD dwMinorVersion;" & _
        "DWORD dwBuildNumber;DWORD dwPlatformId;WCHAR szCSDVersion[128];" & _
        "WORD wServicePackMajor;WORD wServicePackMinor;WORD wSuiteMask;BYTE wProductType;BYTE wReserved;endstruct"


Global $sInformation = "===========================" & @CRLF & _
        "AutoIt version: " & @AutoItVersion & @CRLF & _
        "Windows version: " & _WinAPI_GetVersion() & "  - " & "  Build: " & @extended & @CRLF & _
        "@OSVersion: " & @OSVersion & @CRLF & _
        "@OSType: " & @OSType & @CRLF & _
        "===========================" & @CRLF

ConsoleWrite($sInformation & @CRLF)
ClipPut($sInformation)
MsgBox(262144 + 64, @ScriptName, $sInformation, 300)

Func _WinAPI_GetVersion()
    ; wProductType enum ; https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexw
    Local Enum $VER_NT_NoClue, $VER_NT_WORKSTATION, $VER_NT_DOMAIN_CONTROLLER, $VER_NT_SERVER
    Local $aProductType[5] = ["VER_NT_NoClue", "VER_NT_WORKSTATION", "VER_NT_DOMAIN_CONTROLLER", "VER_NT_SERVER"]

    Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
    DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))

    Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
    If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0)

    ConsoleWrite("dwPlatformId: " & DllStructGetData($tOSVI, "dwPlatformId") & @CRLF) ; note: The operating system platform. This member can be VER_PLATFORM_WIN32_NT (2).
    ConsoleWrite("wProductType: " & DllStructGetData($tOSVI, "wProductType") & _
            " = " & $aProductType[Int(DllStructGetData($tOSVI, "wProductType"))] & @CRLF) ; <<<<

;~         MsgBox(0, "OSVERSIONINFO", "MajorVersion = " & DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _
;~                         "MinorVersion = " & DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _
;~                         "BuildNumber = " & DllStructGetData($tOSVI, "BuildNumber"))

    Return SetError(0, Number(DllStructGetData($tOSVI, "dwBuildNumber")), Number(DllStructGetData($tOSVI, "dwMajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE))
EndFunc   ;==>_WinAPI_GetVersion

... I guess it'll need a table to tell what is v10 that is not Win10 ?

...win32/sysinfo/getting-the-system-version ( they should have done better than this )

in .../windows-server-release-info the "LastBuild" should be the table for the newer servers.

Actually, .../wiki/List_of_Microsoft_Windows_versions has a complete table.

Edited by argumentum
more

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted (edited)

In autoit.de a user said that if the script was closed from the tray, something lingered and did not close the process. This was the example he gave:

#include <Array.au3>
Local $a[1]
_ArrayDisplay($a)

Looked into it and this is the fix I propose:

...
    Local $hGUI = GUICreate(...
    GUICtrlCreateLabel("@ArrayDisplayInternals@GUIidentifier@", 0, -10, 0, 0) 
...
    ; Switch to GetMessage mode
    Local $iOnEventMode = Opt("GUIOnEventMode", 0), $aMsg
    ConsoleWrite("__ArrayDisplay_Share() loadded in: " & TimerDiff($hRetTimer) & @CRLF)
    __ArrayDisplay_OnExit_CleanUp(1, $hGUI, $iCoordMode, $iOnEventMode, $_iCallerError, $_iCallerExtended, $p__ArrayDisplay_NotifyHandler) ) ; add this
    OnAutoItExitRegister(__ArrayDisplay_OnExit_CleanUp) ; add this
...
                    ; Pass array and selection to user function
                    $hUser_Function($_g_ArrayDisplay_aArray, $aiSelItems)
                    $_g_ArrayDisplay_bUserFunc = False
                    OnAutoItExitUnRegister(__ArrayDisplay_OnExit_CleanUp) ; add this
...
    #EndRegion GUI Handling events

    OnAutoItExitUnRegister(__ArrayDisplay_OnExit_CleanUp) ; add this
    __ArrayDisplay_CleanUp($hGUI, $iCoordMode, $iOnEventMode, $_iCallerError, $_iCallerExtended, $p__ArrayDisplay_NotifyHandler)
...
Func __ArrayDisplay_OnExit_CleanUp($iInit = 0, $hGUI = "", $iCoordMode = "", $iOnEventMode = "", $_iCallerError = "", $_iCallerExtended = "", $p__ArrayDisplay_NotifyHandler = "")
    #forceref $iInit
    Local Static $Saved_hGUI = "", $Saved_iCoordMode = "", $Saved_iOnEventMode = "", $Saved__iCallerError = "", $Saved__iCallerExtended = "", $Saved_p__ArrayDisplay_NotifyHandler = ""
    If Int(Eval("iInit")) Then
        If IsHWnd($hGUI) Then
            $Saved_hGUI = $hGUI
            $Saved_iCoordMode = $iCoordMode
            $Saved_iOnEventMode = $iOnEventMode
            $Saved__iCallerError = $_iCallerError
            $Saved__iCallerExtended = $_iCallerExtended
            $Saved_p__ArrayDisplay_NotifyHandler = $p__ArrayDisplay_NotifyHandler
        EndIf
    Else
        If $Saved_hGUI Then __ArrayDisplay_CleanUp($Saved_hGUI, $Saved_iCoordMode, $Saved_iOnEventMode, $Saved__iCallerError, $Saved__iCallerExtended, $Saved_p__ArrayDisplay_NotifyHandler)
    EndIf
EndFunc   ;==>__ArrayDisplay_OnExit_CleanUp

I will not push it to SVN so if anyone can do it, thanks 
Got the setup going, I'll add it
Done :)

Edited by argumentum
oops

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

Many thanks for the update! Very much appreciate all work people put into making Autoit great 👍

Just wondering of there's been any time spent looking at the built in callback functions, like DllCallbackRegister().

Apologies if I'm wrong, but my understanding is that Autoit's built in callback setup suffers from reentrancy, which can cause the main thread to crash.

This post here raises the issue:

There is an old 32bit dllcallback function on this forum that doesn't suffer this issue, I believe it's due to the critical section setup.

This for me working great, but limited to 32bit.

KR

Jardz

 

 

 

 

 

Posted
23 hours ago, mLipok said:

@rikthhpgf2005 please use this script to post here result as text

19 hours ago, argumentum said:
18 hours ago, argumentum said:

... I guess it'll need a table to tell what is v10 that is not Win10 ?
Actually, .../wiki/List_of_Microsoft_Windows_versions has a complete table.

AutoIt's UDF are so many that at times I learn that something is there only after I reinvent the function 😅

Anywayz, is not a bad idea to have a function to dig into an OS version and for that ns-winnt-osversioninfoexw is a good start.
To share the data collected would be simpler to have it in text to copy and paste to the forum. And to do that I modded _WinAPI_DisplayStruct() here.
With this we can compile future versions of the ever growing way of determining what OS is running.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...