|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
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 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
End Sub
在网上复制了一段代码,用来隐藏窗体的标题栏,32位OFFICE是好用的,但在64位OFFICE里运行就会弹出红色错误,请教高手给修改一下适合32位和64位都可以运行的代码,谢谢
|
|