好友
阅读权限10
听众
最后登录1970-1-1
|
'================================================================================
'功能:对指定窗体进行最小,最大,还原,关闭,隐藏,显示的指定操作
'用法:Call FuckFrm(hwnd,1)
'注意:
' 1代表最小
' 2代表最大
' 3代表还原
' 4代表关闭
' 5代表隐藏
' 6代表显示
'================================================================================
Const SC_MINIMIZE = &HF020& '最小
Const SC_MAXIMIZE = &HF030& '最大
Const SC_RESTORE = &HF120& '还原
Const SC_CLOSE = &HF060& '关闭
Const WM_SYSCOMMAND = &H112
Const WM_SHOWWINDOW = &H18 '隐藏显示
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Sub FuckFrm(ByVal hwnd As Long, ByVal WhatDo As Long)
Select Case WhatDo
Case 1
SendMessage hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0 '最小化
Case 2
SendMessage hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 '最大化
Case 3
SendMessage hwnd, WM_SYSCOMMAND, SC_RESTORE, 0 '还原
Case 4
SendMessage hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 '关闭
Case 5
SendMessage hwnd, WM_SHOWWINDOW, 0, vbNull '隐藏
Case 6
SendMessage hwnd, WM_SHOWWINDOW, 1, vbNull '显示
End Select
End Sub |
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|