G
George J
I have done a bit of research online, but it seems that
setsysmodalwindow is not supported in 32bit systems, only
16bit so i can't use that.
I am ok with basic coding, but after that i don't have
much of a clue so if you could tell me what the code is
trying to do rather than what i think it is doing will be
a big help.
I want to watch the userform's LostFocus event and use a
timer to continually check the form and restore if
required. The timer i can probably manage, but the
LostFocus has me, well - lost.
Very rough coding of what i have so far. (Not sure if
hWnd is available in excel97 so i have been struggling
with that also)
Private Declare Function SetActiveWindow Lib "user32.dll"
(ByVal gj As Long) As Long
Private Declare Function FindWindow Lib "user32"
Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As
String) As Long
Private Declare Function GetActiveWindow Lib "user32" ()
As Long
Private Sub Userform_LostFocus()
Dim gj As Long
Dim WinSelected as long
gj = FindWindow("ThunderXFrame", UserForm1.Caption)
WinSelected = GetActiveWindow()
On Error Resume Next
If Not WinSelected = gj Then
SetActiveWindow gj
End If
End Sub
As you can see, i need some serious help.
All comments welcome.
George
setsysmodalwindow is not supported in 32bit systems, only
16bit so i can't use that.
I am ok with basic coding, but after that i don't have
much of a clue so if you could tell me what the code is
trying to do rather than what i think it is doing will be
a big help.
I want to watch the userform's LostFocus event and use a
timer to continually check the form and restore if
required. The timer i can probably manage, but the
LostFocus has me, well - lost.
Very rough coding of what i have so far. (Not sure if
hWnd is available in excel97 so i have been struggling
with that also)
Private Declare Function SetActiveWindow Lib "user32.dll"
(ByVal gj As Long) As Long
Private Declare Function FindWindow Lib "user32"
Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As
String) As Long
Private Declare Function GetActiveWindow Lib "user32" ()
As Long
Private Sub Userform_LostFocus()
Dim gj As Long
Dim WinSelected as long
gj = FindWindow("ThunderXFrame", UserForm1.Caption)
WinSelected = GetActiveWindow()
On Error Resume Next
If Not WinSelected = gj Then
SetActiveWindow gj
End If
End Sub
As you can see, i need some serious help.
All comments welcome.
George