VB icon

* Ultimate Window Handler! *

Email
Submitted on: 1/2/2015 3:35:00 AM
By: Matt Evans (from psc cd)  
Level: Not Given
User Rating: By 11 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 2474
 
     This is the ultimate window handler. This can *Hide a window* *Show a window* *Minimize Window* *Maximize Window* *Close Window*
 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :* Ultimate Window Handler! *
'**************************************
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:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: * Ultimate Window Handler! *
' Description:This is the ultimate window handler. This can 
*Hide a window*
*Show a window*
*Minimize Window*
*Maximize Window*
*Close Window*
' By: Matt Evans (from psc cd)
'**************************************

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


Other 5 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.