Programming - cpueblo.com

TMemo 에 배경 이미지 깔기~


글쓴이 : 유광희 날짜 : 2002-08-14 (수) 17:15 조회 : 14627

WNDPROC FOriginalProc;

LRESULT CALLBACK ListViewProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	 switch(uMsg)
	 {
		case WM_ERASEBKGND:
			BitBlt((HDC)wParam, 0, 0, frmNotice->Memo1->Width, frmNotice->Memo1->Height, frmNotice->Image1->Canvas->Handle, 0, 0, SRCCOPY);
			return 0;

		case CN_CTLCOLOREDIT:
			SetBkMode( (void *)wParam, TRANSPARENT );
			return 0;

		default:
			return CallWindowProc((FARPROC)FOriginalProc, hWnd, uMsg,
				wParam, lParam);
	 }
}

__fastcall TfrmNotice::TfrmNotice(TComponent* Owner)
	: TForm(Owner)
{
	frmNotice = this;
	msgLoader = "";

	FOriginalProc = (WNDPROC)SetWindowLong(Memo1->Handle, GWL_WNDPROC, (LONG)ListViewProc);
}