Does anyone know of any registry restrictions whereas registry entries cannot be written in?
I had read there may be a few long ago, but I doubt it...
I am administrator, although it's a Win98 box this code fails:
It's just writing an entry to pop up a message box prior to logon either on 98 or NT/2k, pretty handy too:
------------------
Scott
[This message has been edited by Scott Turchin (edited March 29, 2001).]
I had read there may be a few long ago, but I doubt it...
I am administrator, although it's a Win98 box this code fails:
It's just writing an entry to pop up a message box prior to logon either on 98 or NT/2k, pretty handy too:
Code:
Case %IDMAIN_SET If osinfo.dwPlatformId = %VER_PLATFORM_WIN32_NT Then SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", ByVal "LegalNoticeCaption",g_MsgTitle SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", ByVal "LegalNoticeText",g_MsgText Else SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon", ByVal "LegalNoticeCaption",g_MsgTitle SaveSetting %HKEY_LOCAL_MACHINE,ByVal "SOFTWARE\Microsoft\Windows\CurrentVersion\Winlogon", ByVal "LegalNoticeText",g_MsgText End If This SaveSetting function has worked for years, and still does work everywhere else... Function SaveSetting(lpKey As Long,ByVal cMainkey As String, ByVal Key As String, _ ByVal Setting As String) As Long Local hKey As Long Local Result As Long Local zText As Asciiz * 2048 ' ** Create the section If RegCreateKeyEx(lpKey, cMainKey + Chr$(0),0, "", %REG_OPTION_NON_VOLATILE, _ %KEY_ALL_ACCESS, ByVal %NULL, hKey, Result) <> %ERROR_SUCCESS Then Exit Function End If ' ** Save the value for the key If Len(Setting) Then zText = Setting RegSetValueEx hKey, Key+Chr$(0), 0, %REG_SZ, zText, Len(Setting)+1 Else RegSetValueEx hKey, Key+Chr$(0), 0, %REG_SZ, ByVal %NULL, 0 End If ' ** Close the key RegCloseKey hKey Function = %TRUE End Function
Scott
[This message has been edited by Scott Turchin (edited March 29, 2001).]
Comment