- UID
- 269864
- 积分
- 9
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-5-31
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
对多文档界面(MDI)文档窗口进行排列
Public 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 Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Public Const WM_MDICASCADE = &H227
Public Const WM_MDIICONARRANGE = &H228
Public Const WM_MDIMAXIMIZE = &H225
Public Const WM_MDIRESTORE = &H223
Public Const WM_MDITILE = &H226
Public Const MDITILE_HORIZONTAL = &H1
Public Const MDITILE_SKIPDISABLED = &H2
Public Const MDITILE_VERTICAL = &H0
' 可选的排列样式常数
' 这些不是API常数
Public Const ARRANGE_TILE_VERTICAL = 0
Public Const ARRANGE_TILE_HORIZONTAL = 1
Public Const ARRANGE_CASCADE = 2
Public Const ARRANGE_ICONS = 3
Public Const ARRANGE_MAXIMIZE = 4
Public Const ARRANGE_RESTORE = 5
Public Sub ArrangeWindows(Arrangement As Integer, hWnd As Long)
Dim wMsg As Long, wParam As Long
Select Case Arrangement
Case 0 ' 竖向平铺
wMsg = WM_MDITILE
wParam = MDITILE_VERTICAL Or MDITILE_SKIPDISABLED
Case 1 ' 横向平铺
wMsg = WM_MDITILE
wParam = MDITILE_HORIZONTAL Or MDITILE_SKIPDISABLED
Case 2 ' 层叠窗口
wMsg = WM_MDICASCADE
wParam = MDITILE_SKIPDISABLED
Case 3 ' 排列图标
wMsg = WM_MDIICONARRANGE
wParam = 0&
Case 4 ' 最大化当前文档
wMsg = WM_MDIMAXIMIZE
wParam = hWnd
Case 5 ' 恢复当前文档
wMsg = WM_MDIRESTORE
wParam = hWnd
End Select
SendMessage GetParent(hWnd), wMsg, wParam, 0&
End Sub |
|