VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



'Create a Rectangular Form using CreateRectRgn 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 Rectangular Form using CreateRectRgn 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 Rectangular Form using CreateRectRgn 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 Rectangular Region
nhwnd = CreateRectRgn(0, 0, fwidth / 2, fheight / 2)
'Set 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 Rectangular Form using CreateRectRgn and SetWindowRgn API Comments

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

Post your comment

Subject:
Message:
0/1000 characters