• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

change registry from C++ ?

anton

Banned
Hello,

I really need help , I need to change one registry value from within my program , how would I do it ? ... I need to change this (
proxyserver) to other value :


[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="something:8080"


really apreciate it, thanks ; )
 
Use these:

LONG RegOpenKey(
HKEY hKey, // handle to open key
LPCTSTR lpSubKey, // name of subkey to open
PHKEY phkResult // handle to open key
);

LONG RegSetValueEx(
HKEY hKey, // handle to key
LPCTSTR lpValueName, // value name
DWORD Reserved, // reserved
DWORD dwType, // value type
CONST BYTE *lpData, // value data
DWORD cbData // size of value data
);

LONG RegCloseKey(
HKEY hKey // handle to key to close
);

For more info, go to msdn.microsoft.com and use the search function.
 
got it ... does this looks right :



ret=RegOpenKey(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",reghandle);
RegSetValueEx(reghandle,"ProxyServer",0,REG_SZ,"aaa:111",7);
Edit1->Text=ret;
RegCloseKey(reghandle);


then why do I get 87 in ret ; (
 
Back
Top