tags:

views:

76

answers:

1

Hi,

I want to call a function after a form has been maxmized or restored. I know I can something like this:

procedure TfrmMain.WMSysCommand;
begin
   if (Msg.CmdType = SC_MAXIMIZE) OR (Msg.CmdType = SC_RESTORE) then
   begin
     Showmessage(IntToStr(frmMain.Height));
   end;
   DefaultHandler(Msg) ;
end;

But the problem is: this event is fired before the form is actually resized - so when the form is maximized, I get the height of the form BEFORE it was maxmized (but I want the width of the form after it has been maximized).

How to do this? Thanks!

+1  A: 

Hi,

the following link maybe will help you:

http://www.tek-tips.com/viewthread.cfm?qid=809465&page=176

declare this into interface section of this unit

Procedure sizeMove (var msg: TWMSize); message WM_SIZE; 

and implementation of this procedure:

Procedure TfrmMain.sizeMove (var msg: TWMSize);
begin 
 inherited; 
 if (msg.SizeType = SIZE_MAXIMIZED) OR (msg.SizeType = SIZE_RESTORED)then   
  resizeQlikViewReports(); 
end;

best regards,

PS: sorry about being so rude, but I am at work and I don't have the time for explain in detail..

Radu Barbu
@Radu: if you post links to articles, would you please include some info about the article behind the link, perhaps at least the article's title?
Marjan Venema
@Marjan : I was in hurry, that was the reason to put only the links...next time i will be more explicit :)
Radu Barbu