Option Explicit
#If Win64 Then
Private Declare PtrSafe Function FindWindow& Lib "USER32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String)
Private Declare PtrSafe Function SetWindowLong& Lib "USER32" Alias _
"SetWindowLongA" (ByVal hWnd&, ByVal nIndex&, _
ByVal dwNewLong As LongLong)
Private Declare PtrSafe Function EnableWindow& Lib "USER32" _
(ByVal hWnd As LongLong, ByVal fEnable As LongLong)
Private Declare PtrSafe Function ShowWindow& Lib "USER32" _
(ByVal hWnd As LongLong, ByVal nCmdShow As LongLong)
#Else
Private Declare Function FindWindow& Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String)
Private Declare Function SetWindowLong& Lib "user32" Alias _
"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long)
Private Declare Function EnableWindow& Lib "user32" _
(ByVal hWnd As Long, ByVal fEnable As Long)
Private Declare Function ShowWindow& Lib "user32" _
(ByVal hWnd As Long, ByVal nCmdShow As Long)
#End If
Private Sub UserForm_Initialize()
Dim lStyle As Long
lStyle = &H84C80080 Or _
&H20000 Or &H40000
SetWindowLong FindWindow( _
vbNullString, Me.Caption), -16, lStyle
EnableWindow FindWindow( _
vbNullString, Application.Caption), 1
End Sub
|