unitabout.cpp

来自「非常古老的小游戏, 也是我最早编的一个 Borland C++ Builder 」· C++ 代码 · 共 47 行

CPP
47
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "UnitAbout.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormAbout *FormAbout;
//---------------------------------------------------------------------------
__fastcall TFormAbout::TFormAbout(TComponent* Owner)
    : TForm(Owner)
{
  LabelProg->Font->Size = 12;
  LabelHome->Font->Color = clBlue;
  LabelHome->Font->Style = LabelHome->Font->Style<<fsUnderline;
  BnOKDefProc = BnOK->WindowProc;
  BnOK->WindowProc = BnOkWndProc;
  LabelHomeDefProc = LabelHome->WindowProc;
  LabelHome->WindowProc = LabelHomeWndProc;
}
//---------------------------------------------------------------------------
void __fastcall TFormAbout::LabelHomeClick(TObject *Sender)
{
  ShellExecute(Handle,"open",LabelHome->Caption.c_str(),0,"",SW_SHOWNORMAL);
}
//---------------------------------------------------------------------------
void __fastcall TFormAbout::LabelHomeWndProc(Messages::TMessage &Message)
{
  if(Message.Msg==CM_MOUSEENTER)
    LabelHome->Font->Color = clRed;
  else if(Message.Msg==CM_MOUSELEAVE)
    LabelHome->Font->Color = clBlue;
  LabelHomeDefProc(Message);
}
//---------------------------------------------------------------------------
void __fastcall TFormAbout::BnOkWndProc(Messages::TMessage &Message)
{
  if(Message.Msg==CM_MOUSEENTER)
    BnOK->Font->Color = clRed;
  else if(Message.Msg==CM_MOUSELEAVE)
    BnOK->Font->Color = clWindowText;
  BnOKDefProc(Message);
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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