Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AfxSetPerUserRegistration
TRY
Collapse the table of content
Expand the table of content

AfxSetPerUserRegistration

Visual Studio 2008

Updated: March 2009

Sets whether the application redirects registry access to the HKEY_CURRENT_USER (HKCU) node.

void AFXAPI AfxSetPerUserRegistration(
   BOOL bEnable
);

[in] bEnable

TRUE indicates that the registry information is directed to the HKCU node; FALSE indicates that the application writes registry information to the default node. The default node is HKEY_CLASSES_ROOT (HKCR).

Before Windows Vista, applications that access the registry usually use the HKEY_CLASSES_ROOT node. However, with Windows Vista, you must run an application in elevated mode to write to HKCR.

This method enables your application to read and write to the registry without running in elevated mode by redirecting registry access from HKCR to HKCU. For more information, see Linker Property Pages.

If you enable registry redirection, the framework redirects access from HKCR to HKEY_CURRENT_USER\Software\Classes. Only the MFC and ATL frameworks are affected by the redirection.

The default implementation accesses the registry under HKCR.

Header: afxstat_.h

Date

History

Reason

March 2009

Created topic.

Information enhancement.

Community Additions

ADD
Show:
© 2015 Microsoft