Can anyone tell me how to determine the version of common control dll in assembler?
What follows is--I think--all the appropriate data and code from my StopWatch/AlarmClock/Countdown Timer program that has to check if the user has at least version 4.70 of the comctl32.dll file in order to use the DateTimePicker control. I hope this helps. I'm trying to add comments to my code, and submit the whole program to Iczelion to add to his list of source code examples. ;Includes include \masm32\include\comctl32.inc ;For DateTimePicker .DATA lib_name db "C:\WINDOWS\SYSTEM\comctl32.dll", 0 ;library for DateTimePicker dgv db "DllGetVersion", 0 ;function to check version of DLL lib_err db "This Program Requires Version 4.70 of COMCTL32.DLL!", 0 ;warning message .DATA? lib_handle HWND ? ;Handle to check for dll version dvi DLLVERSIONINFO <> ;Structure for Dll Version Info proc_add DWORD ? ;used to store address for DLL .CODE invoke LoadLibrary, ADDR lib_name ;Load comctl32.dll to see if we have at least version 4.70 mov lib_handle, eax ;save handle .IF( eax==NULL ) ;no valid handle returned invoke MessageBox, NULL, ADDR lib_err, NULL, MB_OK ret .ENDIF invoke GetProcAddress, lib_handle, ADDR dgv ;get address of DllGetVersion within comctl32.dll mov proc_add, eax .IF( eax==NULL ) ;no valid address to Proc returned invoke MessageBox, NULL, ADDR lib_err, NULL, MB_OK ret .ENDIF invoke RtlZeroMemory, ADDR dvi, SIZEOF DLLVERSIONINFO ;set DLLVERSIONINFO Stru to zeroes mov dvi.cbSize, SIZEOF DLLVERSIONINFO push OFFSET dvi ;push structure address for DLLGetVersion call proc_add ;call COMCTL32.DLL's DllGetVersion routine cmp dvi.dwMajorVersion, 4 ;major version should be at least 4 jae @F invoke MessageBox, NULL, ADDR lib_err, NULL, MB_OK ret @@: cmp dvi.dwMinorVersion, 70 ;minor version should be at least 70 jae @F invoke MessageBox, NULL, ADDR lib_err, NULL, MB_OK ret @@: ;We get here if the version is at least 4.70 DLLVERSIONINFO STRUCT cbSize dd ? dwMajorVersion dd ? dwMinorVersion dd ? dwBuildNumber dd ? dwPlatformID dd ? DLLVERSIONINFO ENDS