Показать сообщение отдельно

  #462  
Старый 29.11.2007, 00:11
criz
Постоянный
Регистрация: 04.11.2007
Сообщений: 303
Провел на форуме:
811764

Репутация: 119
По умолчанию

Ну вот мой код:
Код:
#include <windows.h>
#include <string.h>

int WINAPI WinMain(HINSTANCE hInstance,  HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow)
{
    HKEY hKey;
    DWORD dwErr;
    DWORD type = REG_SZ;
    char v[80] = " ";
    unsigned long buf;
    char err;
	
	RegOpenKeyExA(HKEY_LOCAL_MACHINE,
                  "SOFTWARE\Eset\Nod\CurrentVersion\Info", 0,
                   KEY_ALL_ACCESS, &hKey);
    if(hKey != ERROR_SUCCESS)
    {
		MessageBoxA(NULL, "Not found", "Error", MB_OK);
        exit(1);
    }
    dwErr = RegQueryValueExA(hKey, "Language", NULL, NULL, &v, &buf);
	if(dwErr==ERROR_SUCCESS)
    {
		MessageBoxA(0,v,"Good!",0);
    }
    else
    {
		MessageBoxA(0, "error", "error", MB_OK);
    }
}
P.S. tnx за линк
 
Ответить с цитированием