Try trapping WM_NCPAINT. This will be sent when the non-client area (window frame) 
needs repainting.

eg.
type
  TMyForm = class(TForm)
    ...
    procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT;
    ...
  end;

procedure TMyForm.WMNCPaint(var Message: TWMNCPaint);
begin
  inherited; {Let the usual painting take place..}
  MyPaintProc; {...then do your repainting here}
end;

(This is crude & untested but should give something to go on :) )
Sorry, can't answer about Windows hooks.
HTH

Chris

-----Original Message-----
From: Jeremy Coulter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 8 October 2002 11:10 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Trapping when a window is repainted


Hi all.
Well, after having a wee bit of spare time.....FINALLY....I have been having a play 
with a wee idea I wanted to look at for ages.
What I wanted to do, was draw some text on the caption of the active window.
I have a wee app. that outputs some data that I would like displayed on every active 
forms caption, just to the left of the minimize, maximize and close window.
I have been able to do this. Its actually quite easy.
BUT, what I want to know IS, is there a way to trap the windows messages for that 
window? i.e. if the form is moved, so I can redraw the text back onto the caption bar.
Can I trap these messges with windows hooks, i.e. create a DLL to do the journalrecord 
stuff?

Thanks,

Jeremy Coulter
 
-------------------------------------------------------------------
All email scanned with Nortons Antivirus 2002
-------------------------------------------------------------------
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to