by Divyalok (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 5th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
To Hide Your Form Completely For A While, N Then Appear.
API Declarations
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
'1st button's caption "Hide" n second's "Exit".
'Add This Code.
Private Sub Command1_Click()
Dim lngRegion As Long
Dim lngReturn As Long
Dim lngFormWidth As Long
Dim lngFormHeight As Long
lngRegion = CreateEllipticRgn(0, 0, Me.Width, Me.Height)
lngReturn = SetWindowRgn(Me.hWnd, lngRegion, True)
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Timer1_Timer()
lngFormWidth = Me.Width / Screen.TwipsPerPixelX
lngFormHeight = Me.Height / Screen.TwipsPerPixelY
lngReturn = SetWindowRgn(Me.hWnd, lngRegion, True)
End Sub