VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Hide or show a window using the ShowWindow/CloseWindow API Calls

by De Lucia Francesco (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 5th October 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Hide or show a window using the ShowWindow/CloseWindow API Calls

API Declarations


Public Const SW_ERASE = &H4
Public Const SW_HIDE = 0
Public Const SW_INVALIDATE = &H2
Public Const SW_MAX = 10
Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_NORMAL = 1
Public Const SW_OTHERUNZOOM = 4
Public Const SW_OTHERZOOM = 2
Public Const SW_PARENTCLOSING = 1
Public Const SW_PARENTOPENING = 3
Public Const SW_RESTORE = 9
Public Const SW_SCROLLCHILDREN = &H1
Public Const SW_SHOW = 5
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1

Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function CloseWindow Lib "user32" (ByVal hwnd As Long) As Long

Rate Hide or show a window using the ShowWindow/CloseWindow API Calls



Private Sub Command1_Click()
    CloseWindow Command1.hwnd
End Sub

Private Sub Form_Click()
    ShowWindow Command1.hwnd, SW_NORMAL
End Sub


Download this snippet    Add to My Saved Code

Hide or show a window using the ShowWindow/CloseWindow API Calls Comments

No comments have been posted about Hide or show a window using the ShowWindow/CloseWindow API Calls. Why not be the first to post a comment about Hide or show a window using the ShowWindow/CloseWindow API Calls.

Post your comment

Subject:
Message:
0/1000 characters