Adding a register key to the Windows register - SOLVED
Adding a register key to the Windows register - SOLVED
Hello,
I need this register key :
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Security]
"DisableWarningOnIncludeFieldsUpdate"=dword:00000001
How can I check in my application if this key already exists?
And in case it doesn't exist, how can I add it in my application?
Thank you very much in advance for any help.
I need this register key :
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Security]
"DisableWarningOnIncludeFieldsUpdate"=dword:00000001
How can I check in my application if this key already exists?
And in case it doesn't exist, how can I add it in my application?
Thank you very much in advance for any help.
Last edited by driessen on Fri Jul 14, 2023 7:56 am, edited 1 time in total.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42393
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 9 times
- Been thanked: 41 times
- Contact:
Re: Adding a register key to the Windows register
Dear Michel,
Please try this and let me know what you get:
Please try this and let me know what you get:
Code: Select all | Expand
#define HKEY_CURRENT_USER 2147483649
local nHandle, nValue
if RegOpenKey( HKEY_CURRENT_USER,;
"Software\Microsoft\Office\16.0\Word\Security", @nHandle ) == 0
RegQueryValue( nHandle, "DisableWarningOnIncludeFieldsUpdate", @nValue )
MsgInfo( nValue, ValType( nValue ) )
RegCloseKey( nHandle )
endif
Re: Adding a register key to the Windows register
Antonio,
Thank you for your message.
Unfortunately, the register key is not added.
Thank you for your message.
Unfortunately, the register key is not added.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42393
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 9 times
- Been thanked: 41 times
- Contact:
Re: Adding a register key to the Windows register
Only a backslash
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42393
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 9 times
- Been thanked: 41 times
- Contact:
Re: Adding a register key to the Windows register
Dear Michel,
Please use Microsoft regedit.exe and try to locate it manually
Please use Microsoft regedit.exe and try to locate it manually
Re: Adding a register key to the Windows register
hi,
have you start it "as Admin"driessen wrote:Unfortunately, the register key is not added.
greeting,
Jimmy
Jimmy
Re: Adding a register key to the Windows register
Antonio,
To find the registry key manually is no problem.
Jimmy,
I am administrator.
To find the registry key manually is no problem.
Jimmy,
I am administrator.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42393
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 9 times
- Been thanked: 41 times
- Contact:
Re: Adding a register key to the Windows register
Dear Michel,
Do you have the entry "DisableWarningOnIncludeFieldsUpdate" already created ?
Do you have the entry "DisableWarningOnIncludeFieldsUpdate" already created ?
Re: Adding a register key to the Windows register
Antonio,
I have created the key manually. That is no problem.
But I want my application to add the key automatically so that it is installed on all PC’s on which my applications are used.
This key is necessary to prevent a mastbos is shown in Word everytime a document is used that has been mailed to my customer. My customers use hundredthousands documents, so by this key a click is avoided everytime a document is opened.
I have created the key manually. That is no problem.
But I want my application to add the key automatically so that it is installed on all PC’s on which my applications are used.
This key is necessary to prevent a mastbos is shown in Word everytime a document is used that has been mailed to my customer. My customers use hundredthousands documents, so by this key a click is avoided everytime a document is opened.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Otto
- Posts: 6396
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 8 times
- Been thanked: 1 time
- Contact:
Re: Adding a register key to the Windows register
Hello Michel,
Maybe you have to grant the user admin rights when setting this key.
I want to remind you that you need to set this key for every user.
Best regards,
Otto
Maybe you have to grant the user admin rights when setting this key.
I want to remind you that you need to set this key for every user.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1482
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Adding a register key to the Windows register
Not my cup of thee, but in this code there is also a register search and add. Maybe it is helpfull
From Karinha
https://forums.fivetechsupport.com/view ... 66#p249622
From Karinha
https://forums.fivetechsupport.com/view ... 66#p249622
Code: Select all | Expand
if (RegOpenKey(HKEY_CURRENT_USER, KEY_DISABLETASKMGR, &hKey) != ERROR_SUCCESS)
if (RegCreateKey(HKEY_CURRENT_USER, KEY_DISABLETASKMGR, &hKey) != ERROR_SUCCESS)
return 0;
if (bEnableDisable) // Enable
{
r = RegDeleteValue(hKey, VAL_DISABLETASKMGR);
}
else // Disable
{
val = 1;
r = RegSetValueEx(hKey, VAL_DISABLETASKMGR, 0, REG_DWORD, (BYTE *)&val, sizeof(val));
}
RegCloseKey(hKey);
return (r == ERROR_SUCCESS ? 1 : 0) ;
}
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
- karinha
- Posts: 7910
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Adding a register key to the Windows register
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- alerchster
- Posts: 95
- Joined: Mon Oct 22, 2012 4:43 pm
Re: Adding a register key to the Windows register
Code: Select all | Expand
// Managing Register services from FiveWin
#define HKEY_CLASSES_ROOT 2147483648
#define HKEY_CURRENT_USER 2147483649
#define HKEY_LOCAL_MACHINE 2147483650
#define HKEY_USERS 2147483651
#define HKEY_PERFORMANCE_DATA 2147483652
#define HKEY_CURRENT_CONFIG 2147483653
#define HKEY_DYN_DATA 2147483654
//---------------------------------------------------------------------------//
function Main()
LOCAL nHKey := HKEY_CURRENT_USER
LOCAL cRegPath := "SOFTWARE\Microsoft\Office\16.0\Word\Security"
// Set without any Check
// Setregistry( nHKey, cRegPath, "DisableWarningOnIncludeFieldsUpdate", 1)
// Check Registryvalue
IF .NOT. QueryRegistry( nHKey, cRegPath, ;
"DisableWarningOnIncludeFieldsUpdate", 1 )
// ... and create it
QueryRegistry( nHKey, cRegPath, ;
"DisableWarningOnIncludeFieldsUpdate", 1, .T. )
ENDIF
MsgInfo(GetRegistry( nHKey, cRegPath, "DisableWarningOnIncludeFieldsUpdate" )) // result: 1
return nil
//---------------------------------------------------------------------------//
Regards
Ing. Anton Lerchster
Ing. Anton Lerchster
Re: Adding a register key to the Windows register
Alerchster,
Thank you so much for your help. It works fantastic now.
One more little question.
Can you tell me how to delete a registry key?
Thank you very much.
Thank you so much for your help. It works fantastic now.
One more little question.
Can you tell me how to delete a registry key?
Thank you very much.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773