Source.c 559 B

12345678910111213141516171819
  1. #include <Stdio.h>
  2. #include <Windows.h>
  3. int main() {
  4. HKEY hMyKey;
  5. if (RegCreateKeyW(HKEY_CURRENT_USER, L"NewMyKey", &hMyKey) == ERROR_SUCCESS)
  6. {
  7. if (RegSetValueEx(hMyKey, L"nameparam", 0, REG_SZ, L"Message", 8 * sizeof(WCHAR)) == ERROR_SUCCESS)
  8. {
  9. WCHAR text[256];
  10. DWORD size = sizeof(WCHAR) * 256;
  11. if (RegGetValueW(hMyKey, NULL, L"nameparam", RRF_RT_REG_SZ, NULL, text, &size) == ERROR_SUCCESS)
  12. {
  13. MessageBoxW(NULL, text, L"YES", MB_OK);
  14. }
  15. }
  16. }
  17. }