registry

Fastest small datastore on Windows

孤街浪徒 提交于 2020-01-13 16:20:18
问题 My app keeps track of the state of about 1000 objects. Those objects are read from and written to a persistent store (serialized) in no particular order. Right now the app uses the registry to store each object's state. This is nice because: It is simple It is very fast Individual object's state can be read/written without needing to read some larger entity (like pulling out a snippet from a large XML file) There is a decent editor (RegEdit) which allow easily manipulating individual items

Unable to read certain registry keys in C

你离开我真会死。 提交于 2020-01-13 13:50:58
问题 I'm using RegOpenKeyEx() and RegQueryValueEx() to try and get the value for six keys in the Windows registry. I'm able to do it for four of the six but am failing on certain others. wchar_t * getRegKeyValue(HKEY rootKeyToGet, LPCWSTR subKeyToGet, LPCWSTR valueToGet) { HKEY resultHKey = 0; wchar_t resultString[255] = L""; DWORD dwType = REG_SZ; DWORD resultSize = 255; // See if the subkey exists. If it does, get its value. if (RegOpenKeyEx(rootKeyToGet, subKeyToGet, NULL, KEY_ALL_ACCESS,

Monitor kernel registry changes

﹥>﹥吖頭↗ 提交于 2020-01-13 13:12:22
问题 Could people please give me pointers (no pun intended) for topics I will need to research in order to be able to do this? I'm not really an expert on Windows, however I'm very quick at picking up new concepts. I saw the process monitor program which Mark Russinovich and Bryce Cogswell wrote: http://technet.microsoft.com/en-gb/sysinternals/bb896645 which can look at everything happening registry key-wise within the kernel. I've been able to do this sort of thing using C# and user-level

How to create a undeletable registry key (or file) in C++

别说谁变了你拦得住时间么 提交于 2020-01-12 09:54:54
问题 I would like to create time limited version of a game I am developping in C++. I already meet some program that create files I am still not able to delete, and other that created registry key very hard to delete (because there were several sub key and needed to change owner to the deeper first, delete it go up, change owner...). Then I think the only way is to create something in the computer that is not (or hardly) deletable to mark the beginning of trial. I know how to create key or file

How to create a undeletable registry key (or file) in C++

给你一囗甜甜゛ 提交于 2020-01-12 09:52:23
问题 I would like to create time limited version of a game I am developping in C++. I already meet some program that create files I am still not able to delete, and other that created registry key very hard to delete (because there were several sub key and needed to change owner to the deeper first, delete it go up, change owner...). Then I think the only way is to create something in the computer that is not (or hardly) deletable to mark the beginning of trial. I know how to create key or file

REG DELETE a value which contains quotes in it, inside a batch file?

血红的双手。 提交于 2020-01-11 13:31:30
问题 I am trying to delete some registry keys in a batch file I made. I found the following code on here and it works good until it hits the REG DELETE for /F "tokens=1,*" %%a in ('REG QUERY "%KEY%" ^| findstr /I /C:"%VALUE%"') do (REG DELETE %KEY% /v %%a) The value is located under [HK_CLASSES_ROOT\Installer\Assemblies\Global] As you can probably see, most the values here have quotes in them for example: ADODB,fileVersion="7.10.2346.0",version="7.0.3300.00",culture="neutral",publicKeyToken=

C++ - getting null values in value read from registry

假装没事ソ 提交于 2020-01-11 11:29:28
问题 My application properly reads and writes to the registry. Now, I need to read a registry value from: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid Here is my code: bool GetWindowsID(string &winID) { HKEY hKey = 0, hKeyType = HKEY_LOCAL_MACHINE; bool status = false; DWORD dwType = 0; DWORD dwBufSize = 256; char value[256] = "\0"; if (RegOpenKeyEx(hKeyType, L"SOFTWARE\\Microsoft\\Cryptography", NULL, KEY_QUERY_VALUE|KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) { dwType = REG_SZ;

Write the registry value without redirect in Wow6432Node

北城余情 提交于 2020-01-11 09:36:09
问题 this code insert the registry value Microsoft.Win32.RegistryKey key; key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION"); key.SetValue("MyBrowser.exe", 8000); textBox1.Text = key.GetValue("MyBrowser.exe").ToString(); key.Close(); in windows 32 bit work, but in 64 bit is inserted to wow6432node how to disable the redirect? 回答1: You need to open the key using RegistryView.Registry64. You specify this

creating vbscript to change defualt wallpaper on win7home machines

随声附和 提交于 2020-01-11 03:58:45
问题 Need help making this script true. i beleave the first part is done file, but registry needs to be reflected from information 4-8 thank you. 1 'this vbscript should be named DefualtWallpaper.vbs 2 'copy this file to a folder. 3 'cat.jpg image should be in same folder as vbscript. dim filesys set filesys=CreateObject("Scripting.FileSystemObject") If filesys.FileExists("%cd%\cat.jpg%") Then filesys.CopyFile "%cd%\cat.jpg%","%windir%\web\wallpaper\windows" 4.'change registry to new file Set

Create a new windows registry key using c++

妖精的绣舞 提交于 2020-01-10 08:56:50
问题 I'm trying to create a new registry key in the windows registry using C++. Here is the code I have so far: HKEY hKey; LPCTSTR sk = TEXT("SOFTWARE\\OtherTestSoftware"); LONG openRes = RegCreateKeyEx( HKEY_LOCAL_MACHINE, sk, 0, NULL, REG_OPTION_BACKUP_RESTORE, KEY_ALL_ACCESS, NULL, &hKey, NULL); if (openRes==ERROR_SUCCESS) { printf("Success creating key."); } else { printf("Error creating key."); } LPCTSTR value = TEXT("OtherTestSoftwareKey"); LPCTSTR data = "OtherTestData\0"; LONG setRes =