C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 팁&트릭
C++Builder Programming Tip&Tricks
[606] 갭션바에 원하는 모양의 제목을 넣자.
김태선 [jsdkts] 10467 읽음    2006-05-12 12:31
본래 델파이로 되어 있는 것은 실험해 보고
빌더로 바꿨습니다.

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    Caption = ""; // 원래의 갭션은 없애 준다.
}
//---------------------------------------------------------------------------
// 넌클라이언트 페인트 메시지에 대해 캡션바를 마음대로 그린다.

void __fastcall TForm1::WMNCPaint(TWMNCPaint& Msg)
{
    inherited::Dispatch((void *)&Msg);
    TCanvas  *C = new TCanvas;
    try
    {
        C->Handle = GetWindowDC(Handle);
        //C->Brush->Color = clActiveCaption;
        C->Brush->Style = bsClear;
        C->Font->Name = "굴림";
        C->Font->Size = 9;
        C->Font->Color = clYellow;
        C->Font->Style = TFontStyles() << fsBold;
        C->TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER) + 4,
            (GetSystemMetrics(SM_CYCAPTION) - abs(C->Font->Height))/2 + 4,
            "제목줄입니다. 그림도 표시할수 있겠죠");
    }
    __finally
    {
        ReleaseDC(Handle, C->Handle);
        delete C;
    }
}
//---------------------------------------------------------------------------

아래는 헤더입니다.
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
private:    // User declarations
    void __fastcall WMNCPaint(TWMNCPaint& Msg);
    BEGIN_MESSAGE_MAP
        VCL_MESSAGE_HANDLER(WM_NCPAINT, TWMNCPaint, WMNCPaint)
    END_MESSAGE_MAP(TForm);
public:        // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif



하나 문제가 있는데 그건 각자 찾아 보시기를...

+ -

관련 글 리스트
606 갭션바에 원하는 모양의 제목을 넣자. 김태선 10467 2006/05/12
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.