|
안녕하세요. 메세지를 잡아 처리하는 컴포넌트를 만들었는데 메세지에 반응을 하지 않습니다.
헤더파일은...
#ifndef Component1H
#define Component1H
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
typedef void __fastcall (__closure *TFormResize)(TObject *Sender, int Width, int Height);
class PACKAGE TComponent1 : public TComponent
{
private:
void __fastcall OnFormResize(TMessage &Message);
TFormResize FOnResize;
protected:
public:
__fastcall TComponent1(TComponent* Owner);
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_SIZE, TMessage, OnFormResize)
END_MESSAGE_MAP(TComponent)
__published:
__property TFormResize OnResize = {read=FOnResize, write=FOnResize};
};
//---------------------------------------------------------------------------
위와 같이 하여 WM_SIZE 메세지에 OnResize 이벤트가 발생하도록 OnFormResize함수내에 코딩하였습니다. 그런데 OnFormResize 자체가 실행이 되지 않는군요. WM_SIZE 메세지가 들어오지 않는다는 것인데 어디를 고쳐줘야 할지 난감합니다.
도움 부탁드립니다. 추가로 컴포넌트 소스도 첨부파일로 올립니다..
|