GetLicenseInfo

 

Description

Get User Name, Company Name, Serial Number, and Registration Code.

Syntax

DWORD GetLicenseInfo( LPSTR lpszRegUserName = NULL, LPSTR lpszCompany = NULL, LPSTR lpszSN = NULL, LPSTR lpszRegCode = NULL )

Parameters

lpszRegUserName
[output]optional buffer to receive registered user name
lpszCompany
[output] optional buffer to receive company name
lpszSN
[output]optional buffer to receive serial number
lpszRegCode
[output]optional buffer to receive registration code

Return

Origin's product code

Examples

EX1

void GetLicenseInfo_ex1()
{
    // output user's name and serial number
    char szUser[LIC_USERINFO_NAME_COMPANY_MAXLEN];
    char szSerial[LIC_OTHER_INFO_MAXLEN];
    DWORD dwProd = GetLicenseInfo(szUser, NULL, szSerial);
    printf("User %s has serial number %s\n", szUser, szSerial);
    // output product type
    string strProd;
    switch( dwProd & 0x000000FF )
    {
     case ORGPRODUCTTYPE_REGULAR:
        strProd = "Regular";
        break;
    case ORGPRODUCTTYPE_PRO:
        strProd = "Pro";
        break;
    default:
        strProd = "Evaluation, Student, or Unknown";
        break;
    }
    printf("User %s is running a %s version of Origin\n", szUser, strProd);    
}

Remark

See Also

header to Include

origin.h

Reference