If RegCreateKey(HKEY_LOCAL_MACHINE,PChar('SYSTEM\CurrentControlSet\Services\EventLog\' + FCategory + '\' + ExtractFileName(FFileName)),MyKey)<>ERROR_SUCCESS Then
Begin
Result:=False;
Exit;
End;
// Set the Event ID message-file name
StrPCopy(AppPath,FFileName);
// Add the Event ID message-file name to the subkey
If RegSetValueEx(MyKey,PChar('EventMessageFile'),0,REG_EXPAND_SZ,@AppPath,StrLen(AppPath)+ 1)<>ERROR_SUCCESS Then
Begin
Result:=False;
Exit;
End;
// Set the supported types flags
dwData:=FTypeFlags;
If RegSetValueEx(MyKey,PChar('TypesSupported'),0,REG_DWORD,@dwData,SizeOf(DWORD))<>ERROR_SUCCESS Then