Hi,
how can I read from one Xbase application information about version of another Xbase application on the sam folder (another EXE file, compiled with ARC file with VERSION information)?
Piotr
Information about EXE version
Re: Information about EXE version
hi,
you need to use Manifest and these Entry in *.ARC File
---
when have a LNK of App you can look under Property which is Last Entry of Popup-Menu ( CTRL + ENTER )
this CODE will open same Property Dialog
you need to use Manifest and these Entry in *.ARC File
Code: Select all
VERSION
"CompanyName" = "Yiu-Software"
"LegalCopyright" = "Copyright (c) Yiu-Software"
"ProductName" = "DXE_DualTabView"
"ProductVersion" = "1.90.0355.51"
"FileDescription" = "DXE Rebar,Toolbar,Tabpage,ListView,Statusbar / ot4xb"
"FileVersion" = "0.7.9.03"
"OriginalFilename" = "XCM.EXE"
//
//LANGUAGE = "de"
//
#define MANIFEST_RESID 1
#define MANIFEST 24
USERDEF MANIFEST
MANIFEST_RESID = FILE ".\..\RES\WIN10.MANIFEST"
when have a LNK of App you can look under Property which is Last Entry of Popup-Menu ( CTRL + ENTER )
this CODE will open same Property Dialog
Code: Select all
WshShell := CreateObject( "WScript.Shell" )
oShell := CreateObject( "Shell.Application" )
IF NIL <> oShell
oFolder := oShell:NameSpace( cPath )
IF NIL <> oFolder
oItem := oFolder:ParseName( cFile )
cName := oItem:name
WSHShell:AppActivate( cName )
oVerbs := oItem:Verbs()
jMax := oVerbs:Count // last Entry of Menu
oVerb := oVerbs:Item( jMax - 1 )
oVerb:DoIt()
oFolder:destroy()
ENDIF
oShell:destroy()
WshShell:destroy()
ENDIF
// remove activeX
oVerbs := NIL
oFolder := NIL
oShell := NIL
WshShell := NIL
greetings by OHR
Jimmy
Jimmy
Re: Information about EXE version
Jimmy,
thanks for your tips. What I need is not only display this information but read into variable, like LoadResource(1,XPP_MOD_EXE,RES_VERSION). I will try
Piotr
thanks for your tips. What I need is not only display this information but read into variable, like LoadResource(1,XPP_MOD_EXE,RES_VERSION). I will try
Piotr
Re: Information about EXE version
hi,
try this for Xbase++ (only)
try this for Xbase++ (only)
Code: Select all
IF !DllInfo(DllName,DLL_INFO_LOADED)
hDll := DllLoad(DllName,NIL,.T.)
lFlag := .T.
ENDIF
hDll := DllInfo(DllName,DLL_INFO_HANDLE)
fVersion := LoadResource(1,hDll,RES_VERSIONFIXED)
aVersion := LoadResource(1,hDll,RES_VERSION)
cDLLpath := DllInfo( hDll, DLL_INFO_PATHNAME )
? "load from "+cDLLpath
? ""
// Main Information
//
IF LEN(fVersion) > 0
? "Product Version: "+LTRIM(STR(fVersion[RES_PRODVER_MS]))+LTRIM(STR(fVersion[RES_PRODVER_LS]))
? " File Version: "+LTRIM(STR(fVersion[RES_FILEVER_MS]))+LTRIM(STR(fVersion[RES_FILEVER_LS]))
? " File Time: "+LTRIM(STR(fVersion[RES_FILETIME_MS]))+LTRIM(STR(fVersion[RES_FILETIME_LS]))
ELSE
? "Product Version: "+"no Information"
? " File Version: "+"no Information"
? " File Time: "+"no Information"
ENDIF
// Detail Information
//
IF LEN(aVersion) > 0
FOR J := 1 TO LEN(aVersion)
? aVersion[J][RES_VERSION_KEY]+": "+aVersion[J][RES_VERSION_VALUE]
NEXT
ELSE
ENDIF
? ""
// when using DLLload() so DLLUnload now
//
IF lFlag
lFlag := .F.
DllUnload(hDll)
ENDIF
greetings by OHR
Jimmy
Jimmy
Re: Information about EXE version
Piotr asked for EXEs. This works for DLLs only.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Information about EXE version
ask ChatGPT
can you tell me how to use GetDetailsOf and Shell.Application to get Property of file ?
can you tell me how to use GetDetailsOf and Shell.Application to get Property of file ?
1. Create an instance of the Shell.Application object:
Set objShell = CreateObject("Shell.Application")
2. Use the GetDetailsOf method to get the property of a file:
strProperty = objShell.NameSpace("C:\MyFolder").GetDetailsOf("MyFile.txt", 0)
The 0 in the above example is the index of the property you want to get. You can find a list of available properties and their corresponding index numbers here:
https://docs.microsoft.com/en-us/window ... tdetailsof
3. To get the value of the property, use the GetDetailsOf method again:
strValue = objShell.NameSpace("C:\MyFolder").GetDetailsOf("MyFile.txt", strProperty)
greetings by OHR
Jimmy
Jimmy