Tools Links Login

* Ultimate Window Handler! *

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

Original Author: Matt Evans

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

Code

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 storm@n2.com
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 134 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.