about.cpp

来自「this is also a unix programme book ,you 」· C++ 代码 · 共 66 行

CPP
66
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "About.h"
#include "Main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
#pragma resource "myres.res"
TFormAbout *FormAbout;
//---------------------------------------------------------------------------
__fastcall TFormAbout::TFormAbout(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TFormAbout::OnWMActive(TMessage &Msg)
{
    TForm::Dispatch(&Msg);
    switch(Msg.WParamLo)
    {
        case WA_ACTIVE:
        case WA_CLICKACTIVE:
            LabelTitle->Font->Color = clGreen;
            ShapeClient->Pen->Color = clGreen;
            ImageTitle->Picture->Bitmap->Handle = LoadBitmap(HInstance,"TITLE_ACTIVE");
            ImageClose->Picture->Bitmap->Handle = LoadBitmap(HInstance,"CLOSE_ACTIVE");
            break;
        case WA_INACTIVE:
            LabelTitle->Font->Color = clMoneyGreen;
            ShapeClient->Pen->Color = clMoneyGreen;
            ImageTitle->Picture->Bitmap->Handle = LoadBitmap(HInstance,"TITLE_INACTIVE");
            ImageClose->Picture->Bitmap->Handle = LoadBitmap(HInstance,"_INACTIVE");
            break;
    }
}

void __fastcall TFormAbout::ImageCloseClick(TObject *Sender)
{
    Close();    
}
//---------------------------------------------------------------------------

void __fastcall TFormAbout::ImageTitleMouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
    Refresh();
    if(Button == mbLeft)
    {
        ReleaseCapture();
        Perform(WM_SYSCOMMAND, 0xf017, 0);
    }    
}
//---------------------------------------------------------------------------

void __fastcall TFormAbout::FormShow(TObject *Sender)
{
    ImageTitle->Width = Width - 2;
    ImageClose->Left = Width - 16;    
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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