Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char** argv)
- {
- ...
- hr = TA_IsGenuineEx(taHandle, &opts);
- if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED || hr == TA_E_INET || hr == TA_E_INET_DELAYED)
- {
- printf("YourApp is activated and genuine! Enable any app features now.\n");
- }
- else // not activated or genuine
- {
- if (TA_IsActivated(taHandle) == TA_OK)
- {
- // There is still activation data on the computer, and it's valid.
- }
- else
- {
- // The customer was never activated or deactivated (or got deactivated).
- }
- hr = TA_CheckAndSavePKey(taHandle, _T("U9MM-4NJ5-QFG8-TWM5-QM75-92YI-NETA"), TA_SYSTEM);
- if (hr == TA_OK)
- {
- printf("Product key saved successfully.\n");
- // try to activate
- hr = TA_Activate(taHandle, NULL);
- if (hr == TA_OK)
- printf("Activated successfully\n");
- else
- printf("Activation failed: hr = 0x%x\n", hr);
- }
- else
- printf("Product key failed to save: hr = 0x%x\n", hr);
- }
- printf("Hello world.\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment