Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to create and set a registry in windows 7 using RegCreateKey( HKEY_CLASSES_ROOT,.......)?

Thanks,
Alex
Posted

If UAC is enabled, you will need to elevate permissions first, and then call RegCreateKeyEx (do not call RegCreateKey - it's obsolete now). Irrespective of UAC, you still need to be running as an Administrator (although with UAC that will still require elevation to run with actual Admin privileges).
 
Share this answer
 
Comments
alexvgeorge 11-Feb-11 7:09am    
Thanks Nishant,

I will try this. Let me state my final objective. I need to register a decoder fitler (.ax) with windows mediaplayer to play a file with custom extension. Do you know how to do this using the registry.

Thanks,
Alex
Hi AlexvGeorge,
Nishant is correct.
Your application must run as an admin than only you create registry.
you can allow your application to run under user account control (UAC) with elevated privileges.
If your application is COM component than use Com Elevation Moniker else Update property ReuireAdministrator.
 
Share this answer
 
Comments
alexvgeorge 11-Feb-11 7:10am    
Thanks Shilpi,
I need to register a decoder fitler (.ax) with windows mediaplayer to play a file with custom extension. Do you know how to do this using the registry.
ShilpiP 11-Feb-11 12:15pm    
Did you mean File Association ??
alexvgeorge 11-Feb-11 18:58pm    
yes and usage of custom codec too by windows media player
ShilpiP 14-Feb-11 0:26am    
There is one tool Sysinternal. Search this on net and execute it than filter it with operation "SetRegistryValue" and than set manually the file with Window Media player. Now you will get all the registry value to set for particular file. Now do set all there registry value programatically.
alexvgeorge 15-Feb-11 5:14am    
Thanks
Hope Registry Setting[^]and this[^] will give you an idea.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900