S
stanely
Unregistered / Unconfirmed
GUEST, unregistred user!
我猜可能是发送一个wm_ncpaint消息,但是wparam参数即hrgn怎么办?<br><br>我的目的是做一个能够刷新control以及以他为parent的所有control的客户区和非客户区的函数,但是如下不能刷新Tform的三维边匡和标题栏,也听不到beep。 <br><br>请指教!!!!<br><br><br>procedure RefreshGroupControls(group: tcontrol);<br>var<br>i:integer;<br>rgn,wrgn,crgn:hrgn;<br>wr:trect;<br>begin<br><br> if nil=group then exit; <br> group.repaint;<br> if group is twincontrol then<br> begin<br> with twincontrol(group) do<br> begin<br> getwindowrect(handle,wr);<br> rgn:=CreateRectRgnIndirect(clientrect);<br> crgn:=CreateRectRgnIndirect(clientrect);<br> wrgn:=CreateRectRgnIndirect(wr);<br><br> if CombineRgn(rgn,wrgn,crgn,RGN_DIFF)=ERROR then beep;<br><br> sendmessage(handle,wm_ncpaint,rgn,0);<br> deleteobject(wrgn);<br> deleteobject(crgn);<br> deleteobject(rgn);<br> //application.ProcessMessages;<br> for i:=0 to ControlCount-1 do<br> begin<br> RefreshGroupControls(Controls);<br> end;<br> end;<br><br> end;<br>end;