M
monkey999
Unregistered / Unconfirmed
GUEST, unregistred user!
我在窗体中使用API函数,<br>AnimateWindowAnimateWindow(Self.Handle, 250, AW_BLEND or AW_ACTIVATE); <br>它使Windows图形界面实现了卷帘、淡入淡出和弹出效果。但一些控件显示正常,其他的<br>控件绘图有错误,还有一些根本不显示!书上说,窗体中的控件的windows程序必须处理<br>WM_PRINT或WM_PRINTCLIENT消息,使它们与AnimateWindow API函数一起使用。<br>以GroupBox为例,要加下面的代码。<br>unit TestGroupBox; <br><br>interface <br><br>uses <br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, <br> StdCtrls; <br><br>type <br> TTestGroupBox = class(TGroupBox) <br> private <br> { Private declarations } <br> protected <br> { Protected declarations } <br> procedure WMPrintClient(var Msg: TMessage); message WM_PRINTCLIENT; <br><br> public <br> { Public declarations } <br> published <br> { Published declarations } <br> end; <br><br>procedure Register; <br><br>implementation <br><br>procedure Register; <br>begin <br> RegisterComponents(''Test'', [TTestGroupBox]); <br>end; <br>procedure TTestGroupBox.WMPrintClient(var Msg: TMessage); <br>begin <br> PaintTo(HDC(Msg.WParam), 0, 0); <br>end; <br>end. <br>可是,无效!为什么? 我在主程序中的加了uses TestGroupBox;也还是不行。<br>怎么办?