home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / nastroje / d45 / IBSB1.ZIP / frmCh.pas < prev    next >
Pascal/Delphi Source File  |  2001-05-29  |  875b  |  46 lines

  1. unit frmCh;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TfrmChild = class(TForm)
  11.     procedure FormCreate(Sender: TObject);
  12.   private
  13.      COWproc,CNWproc:Pointer;
  14.      Procedure CNewWinP(var msg:Tmessage);
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   frmChild: TfrmChild;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. procedure TfrmChild.FormCreate(Sender: TObject);
  28. begin
  29. visible:=false;
  30. CNwProc:=MakeObjectInstance(CNewWinP);
  31. COWproc:=Pointer(SetWindowLong(handle,gwl_wndproc,cardinal(CNwProc)));
  32. end;
  33.  
  34. procedure TFrmChild.CNewwinP(var msg:Tmessage);
  35. begin
  36. msg.Result:=CallWindowProc(COWproc,Handle,msg.msg,msg.Wparam,msg.lParam);
  37.  
  38. if  (msg.msg=wm_move) or (msg.msg=wm_size) or (msg.msg=WM_DRAWITEM) then
  39. begin
  40.    Repaint;
  41. end;
  42. end;
  43.  
  44.  
  45. end.
  46.