#28152 - 2002-09-13 02:54 AM
Re: How Do I locate and use the next available registry value
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
Does anyone know why this code goes into an endless enumloop on Windows 98, but not on NT/2000/XP
This code works fine on all the NT platforms, but goes into an endless loop with Windows 9x, CTRL-C won't break out of it either, but it will end task or if using DEBUG you can quit it.
code:
Break On $UpdateCustom=UpdateDictionary()
Function UpdateDictionary() $HKLMSF = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" $HKLMSMWCV = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" $HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" $app = "winword.exe" $path = readvalue("$HKLMAppPaths\$app","") $WordVer = val(getfileversion("$path","Productversion")) $WordVerFull = GetFileVersion("$path","Productversion") $FileToCopyLocation="\\sm-cag-fp10\logs\" $FileToCopy="WDICustom.dic" $Find = "WDICustom.dic" $EnumRegKey = "HKLM\Software\Microsoft\Shared Tools\Proofing Tools\Custom Dictionaries"
If KeyExist($EnumRegKey) $Index = 0 Dim $ValueName[100], $ValueData[100] While @ERROR = 0 $ValueName[$Index] = ENUMVALUE($EnumRegKey, $Index) $ValueData[$Index] = READVALUE($EnumRegKey, $ValueName[$Index]) If $ValueData[$Index] = $Find $Found = 1 Endif If @ERROR = 0 $Index = $Index + 1 Endif If $Index = ubound($ValueName) ReDim Preserve $ValueName[$Index+100], Preserve $ValueData[$Index+100] Endif Loop $Index = $Index -1 ReDim Preserve $ValueName[$Index], Preserve $ValueData[$Index] If Not $Found $nul = WRITEVALUE($EnumRegKey, val($ValueName[ubound($ValueName)])+1, $Find, "REG_SZ") Endif Return Endif Return Endfunction
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 809 anonymous users online.
|
|
|