c.haslam Posted July 14, 2011 Share Posted July 14, 2011 I am working on ListView styles for Koda. LVS_EX_DOUBLEBUFFER requires ComCtl32.dll version 6.00. V6.00 was introduced in XP., but XP also has V5.82. My script should disable LVS_EX_DOUBLEBUFFER if a user is running V5.82. How can my script determine which version of Comctl32 Autoit is running on XP? This may also be a valid question for Vista and Win7. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
KaFu Posted July 14, 2011 Share Posted July 14, 2011 (edited) MsgBox(0,"",FileGetVersion("ComCtl32.dll")) Edit: Btw, on my Win7 this reports "6.10.7601.17514", so something like if StringLeft(FileGetVersion("ComCtl32.dll"),1) > 5 Then Else endif should do... but I'm not sure if this is really necessary or if LVS_EX_DOUBLEBUFFER might just be ignored in a call to v5.82. Edited July 14, 2011 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
c.haslam Posted July 15, 2011 Author Share Posted July 15, 2011 Thank you. You code works. I get 6.0.2980.6028.For what I am doing, it is not sufficient that LVS_EX_DOUBLEBUFFER be ignored on some PCs. The script I am working on will give any user a way of choosing the styles of his ListView control. The dialog has a checkbox "Double buffer to reduce flicker". This checkbox should be disabled if comctl32.dll is earlier than 6.0 -- so a user with Win 2000 will find that this checkbox is disabled.Two pages on MSDN led to my question: Enabling Visual Styles and Common Control Versions. From these pages I understand that:A manifest or a compiler directive is required to specify 6.0XP (for example) has both 5.82 and 6.0.I guess that, because there is no manifest for AutoIt, 6.0 may be specified in AutoIt.exe. But I don't know. I wish I did! Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
rover Posted July 15, 2011 Share Posted July 15, 2011 Thank you. You code works. I get 6.0.2980.6028.For what I am doing, it is not sufficient that LVS_EX_DOUBLEBUFFER be ignored on some PCs. The script I am working on will give any user a way of choosing the styles of his ListView control. The dialog has a checkbox "Double buffer to reduce flicker". This checkbox should be disabled if comctl32.dll is earlier than 6.0 -- so a user with Win 2000 will find that this checkbox is disabled.Two pages on MSDN led to my question: Enabling Visual Styles and Common Control Versions. From these pages I understand that:A manifest or a compiler directive is required to specify 6.0XP (for example) has both 5.82 and 6.0.I guess that, because there is no manifest for AutoIt, 6.0 may be specified in AutoIt.exe. But I don't know. I wish I did!version 6 is specified in the manifestthis is from a 'compiled' v3.3.6.1 exe (in the stub)<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" I see fascists... Link to comment Share on other sites More sharing options...
Andreik Posted July 15, 2011 Share Posted July 15, 2011 Another way: Global Const $tagDLLVERSIONINFO = "dword cbSize;dword dwMajorVersion;dword dwMinorVersion;dword dwBuildNumber;dword dwPlatformID" MsgBox(0,"ComCtl32.dll Info",DLLGetVersion_ComCtl32()) Func DLLGetVersion_ComCtl32($FLAG=4) Local $ALL_INFO Local $STRUCT = DllStructCreate($tagDLLVERSIONINFO) DllStructSetData($STRUCT,"cbSize",20) Local $RESULT = DllCall("comctl32.dll","int","DllGetVersion","ptr",DllStructGetPtr($STRUCT)) If $RESULT[0] = 0 Then Switch $FLAG Case 0 ;Major Version Return DllStructGetData($STRUCT,"dwMajorVersion") Case 1 ;Minor Version Return DllStructGetData($STRUCT,"dwMinorVersion") Case 2 ;Build Number Return DllStructGetData($STRUCT,"dwBuildNumber") Case 3 ;Platform ID Return DllStructGetData($STRUCT,"dwPlatformID") Case 4 ;All Info $ALL_INFO = "Major Version: " & DllStructGetData($STRUCT,"dwMajorVersion") & @CRLF & _ "Minor Version: " & DllStructGetData($STRUCT,"dwMinorVersion") & @CRLF & _ "Build Number: " & DllStructGetData($STRUCT,"dwBuildNumber") & @CRLF & _ "Platfor ID: " & DllStructGetData($STRUCT,"dwPlatformID") Return $ALL_INFO EndSwitch EndIf EndFunc When the words fail... music speaks. Link to comment Share on other sites More sharing options...
c.haslam Posted July 16, 2011 Author Share Posted July 16, 2011 Thank you both. What happens if a user is running Windows 2000? Does your function return 5.81? Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now