mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:43:04 +00:00
[EXPLORER_NEW]
Provide the ability to query version info (needed for task grouping). Patch by DavidErceg <dave_154@hotmail.com> See issue #4386 for more details. svn path=/trunk/; revision=50367
This commit is contained in:
parent
fceaa9ff48
commit
33579181bb
2 changed files with 81 additions and 0 deletions
|
@ -26,6 +26,12 @@ HANDLE hProcessHeap;
|
||||||
HKEY hkExplorer = NULL;
|
HKEY hkExplorer = NULL;
|
||||||
DRAWCAPTEMP DrawCapTemp = NULL;
|
DRAWCAPTEMP DrawCapTemp = NULL;
|
||||||
|
|
||||||
|
typedef struct _LANGCODEPAGE
|
||||||
|
{
|
||||||
|
WORD wLanguage;
|
||||||
|
WORD wCodePage;
|
||||||
|
} LANGCODEPAGE, *PLANGCODEPAGE;
|
||||||
|
|
||||||
/* undoc GUID */
|
/* undoc GUID */
|
||||||
DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1);
|
DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1);
|
||||||
|
|
||||||
|
@ -270,6 +276,80 @@ SetShellReadyEvent(IN LPCTSTR lpEventName)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
GetVersionInfoString(IN TCHAR *szFileName,
|
||||||
|
IN TCHAR *szVersionInfo,
|
||||||
|
OUT TCHAR *szBuffer,
|
||||||
|
IN UINT cbBufLen)
|
||||||
|
{
|
||||||
|
LPVOID lpData = NULL;
|
||||||
|
TCHAR szSubBlock[128];
|
||||||
|
TCHAR *lpszLocalBuf = NULL;
|
||||||
|
LANGID UserLangId;
|
||||||
|
PLANGCODEPAGE lpTranslate = NULL;
|
||||||
|
DWORD dwLen;
|
||||||
|
DWORD dwHandle;
|
||||||
|
UINT cbTranslate;
|
||||||
|
UINT cbLen;
|
||||||
|
BOOL bRet = FALSE;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
dwLen = GetFileVersionInfoSize(szFileName,&dwHandle);
|
||||||
|
|
||||||
|
if (dwLen > 0)
|
||||||
|
{
|
||||||
|
lpData = HeapAlloc(hProcessHeap,0,dwLen);
|
||||||
|
|
||||||
|
if (lpData != NULL)
|
||||||
|
{
|
||||||
|
if (GetFileVersionInfo(szFileName,
|
||||||
|
0,
|
||||||
|
dwLen,
|
||||||
|
lpData) != 0)
|
||||||
|
{
|
||||||
|
UserLangId = GetUserDefaultLangID();
|
||||||
|
|
||||||
|
VerQueryValue(lpData,
|
||||||
|
TEXT("\\VarFileInfo\\Translation"),
|
||||||
|
(LPVOID *)&lpTranslate,
|
||||||
|
&cbTranslate);
|
||||||
|
|
||||||
|
for (i = 0;i < (cbTranslate / sizeof(LANGCODEPAGE));i++)
|
||||||
|
{
|
||||||
|
/* If the bottom eight bits of the language id's
|
||||||
|
match, use this version information (since this
|
||||||
|
means that the version information and the users
|
||||||
|
default language are the same). */
|
||||||
|
if ((lpTranslate[i].wLanguage & 0xFF) ==
|
||||||
|
(UserLangId & 0xFF))
|
||||||
|
{
|
||||||
|
wnsprintf(szSubBlock,
|
||||||
|
sizeof(szSubBlock) / sizeof(szSubBlock[0]),
|
||||||
|
TEXT("\\StringFileInfo\\%04X%04X\\%s"),
|
||||||
|
lpTranslate[i].wLanguage,
|
||||||
|
lpTranslate[i].wCodePage,szVersionInfo);
|
||||||
|
|
||||||
|
if (VerQueryValue(lpData,
|
||||||
|
szSubBlock,
|
||||||
|
(LPVOID *)&lpszLocalBuf,
|
||||||
|
&cbLen) != 0)
|
||||||
|
{
|
||||||
|
wcsncpy(szBuffer,lpszLocalBuf,cbBufLen);
|
||||||
|
|
||||||
|
bRet = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HeapFree(hProcessHeap,0,lpData);
|
||||||
|
lpData = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
|
||||||
INT WINAPI
|
INT WINAPI
|
||||||
_tWinMain(IN HINSTANCE hInstance,
|
_tWinMain(IN HINSTANCE hInstance,
|
||||||
IN HINSTANCE hPrevInstance,
|
IN HINSTANCE hPrevInstance,
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<library>shell32</library>
|
<library>shell32</library>
|
||||||
<library>shlwapi</library>
|
<library>shlwapi</library>
|
||||||
<library>uuid</library>
|
<library>uuid</library>
|
||||||
|
<library>version</library>
|
||||||
<pch>precomp.h</pch>
|
<pch>precomp.h</pch>
|
||||||
<file>desktop.c</file>
|
<file>desktop.c</file>
|
||||||
<file>dragdrop.c</file>
|
<file>dragdrop.c</file>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue