M
Mikeyhend
Hi,
Does anyone know how to freeze the active window using windows API?
I tried this:
Class named FreezeWindow:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal ClassName As String, ByVal WindowName As String) As Long
Private Declare Function LockWindowUpdate Lib "user32" _
(ByVal hWndLock As Long) As Long
Public Sub Freeze(Window As Window)
Dim hWnd As Long
hWnd = FindWindow("XLMAIN", Application.Caption)
End Sub
Public Sub Unfreeze()
LockWindowUpdate 0
End Sub
Private Sub Class_Terminate()
Unfreeze
End Sub
and in the macro:
dim FreezeWnd as New FreezeWindow
FreezeWnd.Freeze ActiveWindow
FreezeWnd.Unfreeze
I can't get it to work, don't know what's wrong (still learning VBA).
Thanks in advance
Mik
Does anyone know how to freeze the active window using windows API?
I tried this:
Class named FreezeWindow:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal ClassName As String, ByVal WindowName As String) As Long
Private Declare Function LockWindowUpdate Lib "user32" _
(ByVal hWndLock As Long) As Long
Public Sub Freeze(Window As Window)
Dim hWnd As Long
hWnd = FindWindow("XLMAIN", Application.Caption)
End Sub
Public Sub Unfreeze()
LockWindowUpdate 0
End Sub
Private Sub Class_Terminate()
Unfreeze
End Sub
and in the macro:
dim FreezeWnd as New FreezeWindow
FreezeWnd.Freeze ActiveWindow
FreezeWnd.Unfreeze
I can't get it to work, don't know what's wrong (still learning VBA).
Thanks in advance
Mik