VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 创建不规则窗口
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:9637, 日期:2001-06-23
创建不规则窗口
Win32 API 有很多让你意想不到的功能。要创建特殊的不规则窗口看上去似乎很难。但我们如果我们说我们用几行代码就可以实现,这似乎不可思议。但事实就是如此!请试试:

Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Private Sub Form_Load()

Show 注释:The form!

SetWindowRgn hWnd, CreateEllipticRgn(0, 0, 300, 200), True

End Sub

上述代码可以创建一个椭圆形状的窗口。怎么样?