|
原帖由 孤鸟 于 2009-3-9 20:44 发表 
二楼的制作只有自己知道吧,怎么不加以说明,打开后是一幅画而已,然后就什么都没有
Option Explicit
Private Declare Function DrawMenuBar Lib "user32" (ByVal Hwnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const GWL_STYLE As Long = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_CAPTION As Long = &HC00000
Private Const WS_EX_DLGMODALFRAME = &H1&
Private Sub UserForm_Initialize()
Dim IStyle As Long
Dim Hwnd As Long
If Val(Application.Version) < 9 Then
Hwnd = FindWindow("ThunderXFrame", Me.Caption)
Else
Hwnd = FindWindow("ThunderDFrame", Me.Caption)
End If
IStyle = GetWindowLong(Hwnd, GWL_STYLE)
IStyle = IStyle And Not WS_CAPTION
SetWindowLong Hwnd, GWL_STYLE, IStyle
DrawMenuBar Hwnd
IStyle = GetWindowLong(Hwnd, GWL_EXSTYLE) And Not WS_EX_DLGMODALFRAME
SetWindowLong Hwnd, GWL_EXSTYLE, IStyle
Application.OnTime Now + TimeValue("00:00:5"), "CloseForm"
End Sub
Private Sub UserForm_Click()
Unload Me '单击窗体后关闭
End Sub |
|