1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Private Declare Function FindWindowA& Lib "User32" (ByVal IpClassName$, ByVal IpWindowName$)
Private Declare Function EnableWindow& Lib "User32" (ByVal hWnd&, ByVal bEnable&)
Private Declare Function GetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&)
Private Declare Function SetWindowLongA& Lib "User32" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
Private Sub UserForm_Activate()
EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
End Sub
Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindowA(vbNullString, Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
End sub |
Partager