Guest User

Untitled

a guest
May 31st, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. int main(int argc, char** argv)
  2. {
  3. ...
  4. hr = TA_IsGenuineEx(taHandle, &opts);
  5. if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED || hr == TA_E_INET || hr == TA_E_INET_DELAYED)
  6. {
  7. printf("YourApp is activated and genuine! Enable any app features now.\n");
  8. }
  9. else // not activated or genuine
  10. {
  11. if (TA_IsActivated(taHandle) == TA_OK)
  12. {
  13. // There is still activation data on the computer, and it's valid.
  14. }
  15. else
  16. {
  17. // The customer was never activated or deactivated (or got deactivated).
  18. }
  19. hr = TA_CheckAndSavePKey(taHandle, _T("U9MM-4NJ5-QFG8-TWM5-QM75-92YI-NETA"), TA_SYSTEM);
  20. if (hr == TA_OK)
  21. {
  22. printf("Product key saved successfully.\n");
  23.  
  24. // try to activate
  25. hr = TA_Activate(taHandle, NULL);
  26.  
  27. if (hr == TA_OK)
  28. printf("Activated successfully\n");
  29. else
  30. printf("Activation failed: hr = 0x%x\n", hr);
  31. }
  32. else
  33. printf("Product key failed to save: hr = 0x%x\n", hr);
  34. }
  35.  
  36. printf("Hello world.\n");
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment