registry

Windows CE Registry Setting - Never Power Off

I have a unique industrial application where I do not want the Windows CE device to ever power off (powering off cuts the wireless connection, resulting in a looooong delay re-establishing a link to the server). The issue: a hard reset removes the "never turn off" setting of the device, allowing it to sleep. Avoiding a hard reset is no...

RegOpenKeyEx fails on HKEY_LOCAL_MACHINE

Hi I'm trying to read a registry value that gives me the path to firefox.exe. This is stored under HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.0.10\bin (the version number can be found somewhere else) But I cant seem to get RegOpenKeyEx to return ERROR_SUCCESS for anything under HKEY_LOCAL_MACHINE so this test fails: if...

Registry Watcher C#

I'm a newbie to WMI and I need to implement RegistryValueChangeEvent in a C# service. I need an event handler that gets triggered each time any one of a set of registry values is changed. I want behavior similar to the FileSystemWatcher class's Changed event, but for registry values. If there's some other technique I could use to acco...

Windows XP, HKCU\...\LastVisitedMRU maximum number of items allowed?

I have a scenario where I need to put together a script to add an entry to the following registry key for the current user: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU\ I am trying to find out the maximum number of values allowed in this key so that I can have my script tack another one...

Tracing registry operations in C#.

Hello, I have a problem. I need to trace all read/write operations to the registry made by various different programs. I need to do this tracing from within a C# program. Can I do this, or is it impossible? ...

IE toolbar, visible by default.

Hi, i have created an IE band object (toolbar) that is working well. however, when installed on a new machine it is not visible by default. Of course one can turn it on by right clicking the toolbar area and selecting it, however, i would like to know if there is a way or an option in the registry that will enable me to have the bar turn...

Monitor changes to the registry

Are there any classes in .net I can use to monitor any change to a value in the registry, similar to how FileSystemWatcher works. So if the value is changed, an event is raised. Or any other suggestions to do this would be helpful. ...

convert std::string to const BYTE* for RegSetValueEx()

I have a function that gets a std::string. That function calls RegSetValueEx the 5th parameter is the value of the registry value and expects a variable of type const BYTE*. So I have to convert the std::string to const BYTE* and also give the length of the resulting array as the 6th parameter. I have found a way to do it, but it feel...

.net installation project registry problem

Hi, I'm making an installation project for my .net app (c#), and i want it to add some entries to the registry, but in some of them I need to write the installation folder, and in other I want to save the full path of the main result of the app (the .exe file) How can i do this? are there some special variables or something like that i...

How to store a time zone preference under Windows XP AND Vista

Between Windows XP and Vista (and server 2003 and 2008) Microsoft have removed the Index key from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones and guess which value we store in our database to record an employee's time zone... (See http://support.microsoft.com/kb/935369). What is the best value to use inst...

How to create a Visual Studio Setup Project registry value with the application install path?

I have a very simple application installer that needs to add an action to the shell menu of all files (HKCR*\shell), and I've run into a brick wall: how do I insert the installed path of the application into a registry value? I've tried everything I can think of: [Path] [ApplicationFolder] [ApplicationPath] [InstallPath] [InstallRoot]...

Using C++ to edit the registry

I have a limited c++ background and I would like to edit the registry. For example, I want to grab the value of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun and check to see if 0x20 is in it, and then if it is, subtract 0x20 from it's value and write it back (and kill and restart explor...

Why isn't my change to the registry persisting in C++?

I'm attempting to edit the registry with C++ and this is my first time trying to do so, and I'm failing. I'm not getting any error code, everything says it completed successfully, but it doesn't actually change the registry key. Here is the code I am using: HKEY hkey; DWORD dwDisposition, dwType, dwSize; int autorun = 0x00; int CD_AUTO...

Windows 64-bit registry v.s. 32-bit registry

Hello everyone, I heard on Windows x64 architecture, in order to support to run both x86 and x64 application, there is two separate/different sets of Windows registry -- one for x86 application to access and the other for x64 application to access? For example, if a COM registers CLSID in the x86 set of registry, then x64 application wi...

Windows Mobile Registry UnauthorizedAccessException

I wrote three programs that modifies the registry in Windows Mobile to install and remove a todayscreen plugin for debugging purposes. They worked great for a while, but one by one they have suddenly been giving "UnauthorizedAccessException"s. See the code for two of the programs below (note that the following code just sits directly in...

How to read registry branch HKEY_LOCAL_MACHINE in Vista?

I have Application settings stored under HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany branch. Settings must be same for different users and that is the reason why settings are not under HKEY_CURRENT_USER. Registry values are only read during use of application. Now, in Windows Vista and due to UAC you can't anymore use following code to read r...

Delete a registry key recursively

I need to remove a subtree in the Windows registry under Windows Mobile 6. The RegDeleteTree function is not available, and SHDeleteKey is (apparently) not available in any static library under the WM6 SDK, though the declaration is available in shlwapi.h. I tried to get it from shlwapi.dll, like typedef DWORD (__stdcall *SHDeleteKe...

Launch app on startup for all users, but also allow per-user setting (Windows)

I need my application installer set the program to auto-startup for all users. Then each individual user should be able to modify this option without affecting others. Currently I write to HKLM/../Run with installer, which acomplishes the first task. But then I can't disable autorun for current user, because deleting th HKLM/../Run entr...

How to decide where to store per-user state? Registry? AppData? Isolated Storage?

When should the Windows Registry be used for per-user state, and when should we use the filesystem, particularly the user's AppData folder? (eg, C:\Users\USERNAME\AppData). Where does Isolated Storage come in? Is there a pretty firm rule, or is it just a fuzzy thing, like "use the registry until it becomes too much data to store in the...

How to check if specific web browser is installed on system?

How to check if specific web browser (chrome, firefox, opera) is installed on system? (C++/Windows platform). Maybe this can be check in somewhere in registry? ...