Application and case of the registry (below) text / Dong Yi's last article We speak the data type. Only these three data types are used in the registry, and there are other types, but not often used here, I will not introduce. When using regSetValue () to create a button, the VC will provide some data types and data pointers of these data to facilitate operations of key values, while the user can save two-way arbitrary types, such as: struct type, 32 value And strings, etc.. One thing to note is that when writing Win3.x programs, the registry only supports the REG - SZ type data, which is noted in programming. After a certain understanding of the data type, let's take a look at how to manage the key value. We have already told how to build a key, how to open a known key and how to delete him. The operation of the key is combined with the data type talled above, you can understand the prototype of the following functions. 4. The RegQueryValueEx () Prototype: LONG RegQueryValueEx (HKEY hKey; LPTSTR lpValuename; LPDWORD lpReserved; LPDWORD lpType; LPBYTE lpData; LPDWORD lpcbData;) Explanation: Examples of types of data, and returns an indication registry key: DWORD dwSize = (DWORD) nSize; BOOL bRet = (: RegQueryvalueex (m_hKey, lpszvalueename, null, null, (unsigned char *) lpreturnBuffer, & dwsize) == Error_Success); m_dwlasterror = getLastError (); now which functions we have said are managed by the registry, This function and the following functions are implemented by the handle of the required registry. The handle of the registry is obtained by calling regopenkeyex () and regreateKeyex () functions. This function is used to read a known key value for the registry. Use this function to get the name of the desired key value, and return a data, data length, and data type. However, the handle of this registry must be obtained before this, and the handle is obtained through the regroenkeyex () function. When setting and modify it, the user calls this function. However, it is important to note that in order to enable this function to access, you must use the key_set_value permission to open the key. (This permissions are set in the regreateex () or regopenkeyex () function) 5. RegopenKeyex () prototype: WinAdvapi Long Apientry Regopenakeyex (HKEY HKEY, LPCTSTSTR LPSUBKEY, DWORD ULOPTIONS, Regsam Samdesired, Phkey PhkResult); Interpret: Open the specified key or subkey. The handle returned for further access. You should use RegCloseKey () to close each open button. Example: HKEY HKEY; Const Char * LPSZSUBKEY :: RegopenKeyex (HKEY, LPSZSUBKEY, 0, key_all_access, & m_hkey) This function is not good. His meaning is as good as his name. That is to open a key or subkey that gives a given correct path. I explain this function.