VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 23rd January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API

API Declarations


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

Rate 'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API



'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]
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
'Create Round Rectangular Region
nhwnd = CreateRoundRectRgn(0, 0, fwidth - 25, fheight - 25, fwidth - 50, fheight - 50)
'Create Elliptic Region
'nhwnd = CreateRoundRectRgn(0, 0, fwidth - 50, fheight - 50, fwidth - 50, fheight - 50)
'Set Round Rectangular Region on form
rval = SetWindowRgn(Me.hWnd, nhwnd, True)
rval = DeleteObject(nhwnd)
End Sub

Download this snippet    Add to My Saved Code

'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API Comments

No comments have been posted about 'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API. Why not be the first to post a comment about 'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API.

Post your comment

Subject:
Message:
0/1000 characters