我怎么试了一下可以呢?<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br> function dlgpro(dlghandle:hwnd;dlgmsg:uint;dlgwp:wparam;dlglp:lparam):boolean;stdcall;<br> var<br> adc:hdc;<br> arect:trect;<br> agdiobj:hgdiobj;<br> p
AINTSTRUCT;<br> begin<br> case dlgmsg of<br> wm_initdialog:<br> begin<br> result:=true;<br> end;<br> wm_paint:<br> begin<br> BeginPaint(dlghandle,p);<br> agdiobj:=getstockobject(black_brush);<br> fillrect(p.hdc,p.rcPaint,agdiobj);<br> EndPaint(dlghandle,p);<br> end;<br> end;<br> end;<br>var<br> ainstance,ret:thandle;<br>begin<br> ainstance:=loadlibrary('comdlg32.dll');<br> if ainstance <> 0 then begin<br> ret:=createdialog(ainstance,MAKEINTRESOURCE(1547),application.handle,@dlgpro);<br> if ret=0 then showmessage('Create dialog failed !');<br> freelibrary(ainstance);<br> end<br> else showmessage('Load library failed !');<br>end;<br><br><br>end.<br>