regkey.cpp
上传用户:graphite
上传日期:2020-09-09
资源大小:2587k
文件大小:2k
源码类别:

破解

开发平台:

Others

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <windows.h>
  5. #include "regkey.h"
  6. #include "includeaspr_api.h"
  7. //---------------------------------------------------------------------------
  8. #pragma package(smart_init)
  9. #pragma resource "*.dfm"
  10. TfrmRegKey *frmRegKey;
  11. char* LocalHardwareID = NULL;
  12. //---------------------------------------------------------------------------
  13. __fastcall TfrmRegKey::TfrmRegKey(TComponent* Owner)
  14.         : TForm(Owner)
  15. {
  16. }
  17. //---------------------------------------------------------------------------
  18. void __fastcall TfrmRegKey::FormCreate(TObject *Sender)
  19. {
  20.   LocalHardwareID = GetHardwareID();
  21.   Edit1->Text     = StrPas( LocalHardwareID );
  22. }
  23. //---------------------------------------------------------------------------
  24. void __fastcall TfrmRegKey::Button4Click(TObject *Sender)
  25. {
  26.   char buffer[256];
  27.   memset( (char*)buffer, 0, sizeof(buffer));
  28.   lstrcat(buffer,"mailto:support@aspack.com?subject=Hardware%20ID%20for%20Advanced%20Application%201.0&body=Hardware%20ID is%20:%20");
  29.   lstrcat(buffer,LocalHardwareID);
  30.   lstrcat(buffer,"%0d%0aRegistration%20information%20:");
  31.   ShellExecute(GetDesktopWindow(), "open", buffer, NULL, NULL, SW_SHOWNORMAL);
  32. }
  33. //---------------------------------------------------------------------------
  34. void __fastcall TfrmRegKey::btnRegOkClick(TObject *Sender)
  35. {
  36.   if (CheckKeyAndDecrypt( eCode->Text.c_str(), eName->Text.c_str(), TRUE ) == TRUE)
  37.   {
  38.     MessageBox(Handle, "Thank you for your registration!", "Registration", MB_ICONINFORMATION);
  39.     Close();
  40.   } else
  41.     MessageBox(Handle, "Key is not valid, please contact manufacture!","Registration", MB_ICONWARNING);
  42. }
  43. //---------------------------------------------------------------------------
  44. void __fastcall TfrmRegKey::btnRegPasteClick(TObject *Sender)
  45. {
  46.   eCode->Clear();
  47.   eCode->PasteFromClipboard();
  48. }
  49. //---------------------------------------------------------------------------