📄 mainform.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Mainform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
if(this->OpenDialog1->Execute())
{
this->Edit1->Text=this->OpenDialog1->FileName;
}
}
//---------------------------------------------------------------------------
#include "Registry.hpp"
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
if(this->Edit1->Text.Length()<1)
return;
TRegistry* Reg=new TRegistry();
Reg->RootKey=HKEY_LOCAL_MACHINE;
if(Reg->OpenKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run",false))
{
Reg->WriteString("我的自动运行程序",this->Edit1->Text.c_str());
Reg->CloseKey();
MessageBox(Handle,"设置程序在系统启动时自动运行操作成功!","信息提示",MB_OK);
}
delete Reg;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -