同志们看下是不是啊
SetWindowRgn(MainForm.Handle,MainFormRegion, True);
GetRegionData(MainFormRegion, SizeOf(TRgnData), nil); //得到大小
RaiseLastOSError;System Error.  Code: 6.句柄无效。'

解决方案 »

  1.   


    After a successful call to SetWindowRgn, the system owns the region specified by the region handle hRgn. The system does not make a copy of the region. Thus, you should not make any further function calls with this region handle
      

  2.   

    重贴下MSDN:
    After a successful call to SetWindowRgn, the system owns the region specified by the region handle hRgn. The system does not make a copy of the region. Thus, you should not make any further function calls with this region handle. In particular, do not delete this region handle. The system deletes the region handle when it no longer needed.
      

  3.   

    Google 翻译
    经过成功的呼叫SetWindowRgn,该系统拥有该区域处理hRgn指定的区域。该系统不会使该区域的一个副本。因此,你不应该再有任何的函数调用与这个地区的处理。特别是,不要删除这个地区处理。该系统将删除该区域处理时不再需要。看来hRgn是不能用了