windows-registry

Bad Registry values for File Association,File/Path References, Program Shortcuts in c#

How to get the bad registry values for File Association,File/Path References, Program Shortcuts. I don't know ,which registry keys should i used to get the bad registry values of those. Any help would be appreciated. thanx in advance. ...

How to get Registry error for file association, file/path refernces, program shortcut in c#

Hi I am developing a registry cleaner and for that i have to find out registry error in the windows registry. If we talk about registry error in Shared dlls i get the registry error with the following code: RegistryKey regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\SharedDLLs"); same thing i want...

How to read a REG_MULTI_SZ type value from the registry using RegQueryValueEx(..) in c++

In our vc++ win32 application we are reading a registry value of type reg_multi_sz, its working fine on 32-bit but giving empty buffer when i ran on 64- bit. How can I read values of 64 bit registry from my 32-bit application ? ...

Is There Any Reason Not To Use The Windows Registry For Program Settings?

To me its a no-brainer. The settings for my program go into the Windows Registry. After all, that's what it's for, isn't it? But some programmers are still hesitant in using the Registry. They state that as it grows it slows down your computer. Or they state that it gets corrupted and causes your computer to malfunction. So they write...

Windows Context menu shell icon

I have created a new Windows shell context menu item using registry and keys HKLM\Software\Classes\Folder\shell\appname HKLM\Software\Classes\Folder\shell\appname\command now I want to add an icon to this command. How I do that? ...

Correct way to check if Windows is 64 bit or not, on runtime? (C++)

bool Win64bit = (sizeof(int*) == 8) ? 1 : 0; I need this so my app can use Windows registry functions properly (or do i need?). So am i doing it right ? ...

How to set a value in windows registry? (C++)

I want to edit key "HKEY_LOCAL_MACHINE\Software\company name\game name\settings\value" to "1" (DWORD) This is my code: HKEY hkey; DWORD dwDisposition; if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\company name\\game name\\settings"), 0, NULL, 0, 0, NULL, &hkey, &dwDisposition) == ERROR_SUCCESS){ DWORD dwType, dwSize; dwTy...

Where to store a connection string used by many applications in the same machine?

At my shop we are used to store connections strings in the .config file. But when we had to update it in several applications in the same machine someone gave the idea of storing it on the windows registry. Is this a good idea? What are the implications (security)? ...

New AppDomain from MMC Snap-In does not get elevated privileges for UAC

I've created an MMC snap in that launches code in a new appdomain and part of the code checks for a registry key. If I check for the key in the snap in process it works, but the code in the new appdomain throws a security exception. If I load the code in a new appdomain from a console or windows app, it works fine. Here is the code: p...

RegQueryValueEx() always returns only 4 bytes of the string

What im doing wrong this time? The following code always returns 4 bytes only, instead of the whole string: HKEY hkey; DWORD dwType, dwSize; char keybuffer[512]; if(RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("software\\company name\\game name"), 0, KEY_READ, &hkey) == ERROR_SUCCESS){ dwType = REG_SZ; dwSize = sizeof(keybuffer); ...

Multiple Applications, Shared Settings: Use the registry or XML-based configuration?

My Scenario I have a class library that is going to be called from multiple separate executable applications. This class library needs to know about an address of a database server (and many other configuration options, auth info, etc) to access. I have a configuration and administration application, separate from the class library, tha...

How can I find sql server port number from windows registry?

How can I find sql server port number from windows? Is there any generic way to find port number for sql server 2000, 2005 and 2008? ...

Using C++ to import registry files

Hello everyone, I'm having some problems of getting the following simple code to run correctly: #include <process.h> int main( void ) { system("foo.reg"); //why does this NOT WORK?! //system("reg import foo.reg"); //why does this NOT WORK?! //system("regedit \"foo.reg\""); //why does this NOT WORK?! return 0; } ...

Using C++ to Merge .reg files

Hey, I am simply trying to merge a .reg file into my registry using a very basic c++ program. The code is as follows: #include <iostream> #include <iomanip> #include <string> #include <fstream> #include <stdlib.h> #include <cstdlib> #include <stdio.h> #include <windows.h> using namespace std; int main() { string file = "regedit.e...

Registering and using out-of-proc COM server in an isolated way (SxS)

Hi, We have the following configuration: IE->Creates new process->Process uses out-of-proc COM server We would like to enjoy side-by-side for our new process and out-of-proc COM server which are deployed in an isolated folder. We thought using COM registration with relative path but it looks that when trying to load the COM server, svc...

Registry entry for different SQL Server

Which are the reliable registry entries to see install versions of SQL Server? Like if I have 2005 and 2008 both installed on my machine, how can I check this in registry? Also how to check which is the default one? ...

How to access HKCU registry of currently logged on user(s), from a service?

From within a windows service I want to check some user preferences that are stored within each users' HKCU registry area. How can I do this? I see that HKEY_USERS has subkeys of each user that has logged in to the machine (or something like that?), and within these are the HKCU areas for each user. However, these subkeys are the SIDs o...

How to remove HKCU registry keys when uninstalling software?

When my software is installed, via an MSI, it creates some registry keys within HKLM. When people are using the software their individual preferences are saved to HKCU. When the software is uninstalled the HKLM and HKCU registry keys are deleted, but I'm thinking that it's only the HKCU keys for the user who is running the uninstall that...

C# Question: Retrieve Data from Windows Registry

I store serialized data in the registry. I want to use a foreach loop to iterate through that data. On each iteration I would like to add that data to a dictionary. As follows: // Create dictionary myDictionary = new Dictionary(); // iterate through previously stored data and add it to Dictionary foreach (object x in Application.User...

Does anyone know how to set the default registry value for a key using JNI-Registry (com.ice.jni.registry)?

I'm currently trying to query and set some windows registry entries through a Java app. We are mandated to use the JNI-Registry library (for licensing reasons). The keys and values to set are not under my control (I'm modifying values set by another, 3rd party, application). I can get and set the various entries and values OK for normal...