VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Ultimate Window Handler

by Matt Evans (6 Submissions)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (11 Votes)

This is the ultimate window handler. This can
*Hide a window*
*Show a window*
*Minimize Window*
*Maximize Window*
*Close Window*

API Declarations
Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Public Const WM_CLOSE = &H10
Public Const SW_HIDE = 0
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6

Rate Ultimate Window Handler

Sub WindowHandle(win,cas as long)
'by storm
'Case 0 = CloseWindow
'Case 1 = Show Win
'Case 2 = Hide Win
'Case 3 = Max Win
'Case 4 = Min Win
Select Case cas
Case 0:
Dim X%
X% = SendMessage(win, WM_CLOSE, 0, 0)
Case 1:
X = ShowWindow(win, SW_SHOW)
Case 2:
X = ShowWindow(win, SW_HIDE)
Case 3:
X = ShowWindow(win, SW_MAXIMIZE)
Case 4:
X = ShowWindow(win, SW_MINIMIZE)
End Select
'any questions e-mail me at [email protected]
End Sub

Download this snippet    Add to My Saved Code

Ultimate Window Handler Comments

No comments have been posted about Ultimate Window Handler. Why not be the first to post a comment about Ultimate Window Handler.

Post your comment

Subject:
Message:
0/1000 characters