unit OpenReport;
{$R-,H+,X+}
interface
uses Messages, Windows, SysUtils, Classes, Controls, StdCtrls, Graphics,
ExtCtrls, Buttons, Dialogs;
type
{ TOpenPictureDialog }
TOpenReportDialog = class(TOpenDialog)
private
OldProc:TWndMethod;
public
procedure ResizeProc(var Mes:TMessage);
end;
{ TSavePictureDialog }
TSaveReportDialog = class(TOpenReportDialog)
public
function Execute: Boolean; override;
end;
implementation
uses Consts, Forms, CommDlg, Dlgs,main;
{ TOpenPictureDialog }
{$R EXTDLGS.RES}
constructor TOpenReportDialog.Create(AOwner: TComponent);
begin
OldProc:=TControl(self).WindowProc;
TControl(self).windowproc:=ResizeProc;
end;
procedure TOpenReportDialog.ResizeProc(var Mes: TMessage);
begin
if Mes.msg=OFN_ENABLESIZING then showmessage('Resizing Now~'); // 어떤 메세지를 찾아야할지..
OldProc(Mes);
end;
end.
메세지 훅한 부분의 OFN_ENABLESIZING을 WM_WINDOWPOSCHANGING로 바꾸면
되죠?
근데 결과는 안되더라구요..
WM_SIZE두 마찬가지..
보통 폼하고 틀린가봐요..
원래 대화상자는 크기 변경이 안되잖아요.
이놈은 아무래두 특별해서 그런가?
한번 테스트 해주세요..
파일열기대화상자에서의 폼리사이즈 이벤트 받기..
테란쑈당 wrote:
>
> 폼의 크기가 변하려할때는 "WM_WINDOWPOSCHANGING" 메시지가 발생하고
> 폼의 크기가 변하고 나면 "WM_SIZE" 메시지가 발생합니다.
>
> 참고하세요.
>
> ------------------------------------------------------------------------------
>
> 어린왕자 wrote:
> > unit OpenReport;
> >
> > {$R-,H+,X+}
> >
> > interface
> >
> > uses Messages, Windows, SysUtils, Classes, Controls, StdCtrls, Graphics,
> > ExtCtrls, Buttons, Dialogs;
> >
> > type
> >
> > { TOpenPictureDialog }
> >
> > TOpenReportDialog = class(TOpenDialog)
> > private
> > OldProc:TWndMethod;
> > public
> > procedure ResizeProc(var Mes:TMessage);
> > end;
> >
> >
> > { TSavePictureDialog }
> >
> > TSaveReportDialog = class(TOpenReportDialog)
> > public
> > function Execute: Boolean; override;
> > end;
> >
> > implementation
> >
> > uses Consts, Forms, CommDlg, Dlgs,main;
> >
> > { TOpenPictureDialog }
> >
> > {$R EXTDLGS.RES}
> >
> > constructor TOpenReportDialog.Create(AOwner: TComponent);
> > begin
> > OldProc:=TControl(self).WindowProc;
> > TControl(self).windowproc:=ResizeProc;
> > end;
> >
> >
> > procedure TOpenReportDialog.ResizeProc(var Mes: TMessage);
> > begin
> > if Mes.msg=OFN_ENABLESIZING then showmessage('Resizing Now~'); // 어떤 메세지를 찾아야할지..
> > OldProc(Mes);
> > end;
> >
> > end.