⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aboutformfile.cpp

📁 可以使用硬件指纹作为密钥加密文件
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "EncryptFormFile.h"
#include "DecryptFormFile.h"
#include "AboutFormFile.h"
#include "AddShellFormFile.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "XPMenu"
#pragma resource "*.dfm"
TAboutForm *AboutForm;
TPascalFun *PascalFun; //引用Delphi函数的类
//---------------------------------------------------------------------------
__fastcall TAboutForm::TAboutForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::EncryptFileClick(TObject *Sender)
{
EncryptForm->Show();
this->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::DecryptFileClick(TObject *Sender)
{
DecryptForm->Show();
this->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::ExitClick(TObject *Sender)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::AddShellClick(TObject *Sender)
{
AddShellForm->Show();
this->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::ViewHelpClick(TObject *Sender)
{
AnsiString Helpfile=ExtractFilePath(Application->ExeName)+"Help.CHM";//帮助文档的路径
ShellExecute(Handle,NULL,Helpfile.c_str(),NULL,NULL,SW_SHOWNORMAL);  //打开帮助文档
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::FormCreate(TObject *Sender)
{
try{
TStringList *tmp=new TStringList;
tmp->Text="测试当前文件所在的地方能否创建文件";
tmp->SaveToFile(".\\IsCanWrite.txt");
tmp->Free();
DeleteFile(".\\IsCanWrite.txt");
}
catch (...)
{
 ShowMessage("请把 "+ExtractFileName(Application->ExeName)+" 及 HELP.chm 复制到硬盘下使用。");
 Application->Terminate();
}
//----------------------------检测并注册文件类型
  Registry = new TRegistry;
  Registry->RootKey = HKEY_CLASSES_ROOT;
  Registry->OpenKey(".gv", TRUE);
  Registry->WriteString("","NoKeyNoOpen");
  Registry->CloseKey();  
  Registry->OpenKey(".coco", TRUE);
  Registry->WriteString("","NoKeyNoOpen");
  Registry->CloseKey();
  Registry->OpenKey("NoKeyNoOpen\\shell\\open\\command", TRUE);
  Registry->WriteString("",Application->ExeName+" %1");
  Registry->CloseKey();
   Registry->OpenKey("NoKeyNoOpen\\DefaultIcon", TRUE);
  Registry->WriteString("",ExtractFilePath(Application->ExeName)+"FileIcon.ico");
  Registry->CloseKey();
  
    Registry->Free();
//----------------------------检测并注册文件类型
}
//---------------------------------------------------------------------------
void __fastcall TAboutForm::SetupAllDeleteClick(TObject *Sender)
{
if(Application->MessageBoxA("<<灭文器 v1.00>>可以彻底地删除文件(即文件删除被恢复后也只是一堆乱码),更好地保证您文件的安全。\n是否想安装<<灭文器 v1.00>>到系统文件夹“发送到”?",Application->Title.c_str(),MB_YESNO)==IDYES)
{
PascalFun->LoadFromRes("AllDeleteEXE","ExeFile",PascalFun->GetSystemPath()+"\\灭文器 v1.00.exe");
ShowMessage("安装成功!您若想用<<灭文器 v1.00>>删除文件,就把选定的文件或文件夹发送到<<灭文器 v1.00>>。");
}
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -