this example shows how to create a rectangular form in Visual basic
Private Declare Function CreateRectRgn 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 Declare Function DeleteObject Lib “gdi32.dll” (ByVal hObject As Long) As Long
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Dim fwidth As Long, fheight As Long
Dim rval As Long, nhwnd As Long
fwidth = Me.Width / Screen.TwipsPerPixelX
fheight = Me.Height / Screen.TwipsPerPixelY
nhwnd = CreateRectRgn(0, 0, fwidth / 2, fheight / 2)
rval = SetWindowRgn(Me.hWnd, nhwnd, True)
rval = DeleteObject(nhwnd)
End Sub
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.


















