Please help!
I have a problem with a library DLL offering a toolbar object which freezes the
program when the right mouse button is clicked while the cursor is over the
tool bar. There is no update available for that library, and thus I have to repair.
'
'
Select Case CbMsg
Case %WM_TIMER
Do While CursorOverToolBar()
'From here, I have to prevent the right mouse button event
'to be generated at all, just as long as the cursor
'is hoovering one of the toolbars.
''GetAsyncKeyState' does not help here.
end Do
End Select
'
'
'-------------------------------------------------------------------------------------------------------
' FUNCTION CursorOverToolBar
'-------------------------------------------------------------------------------------------------------
Function CursorOverToolBar() As Long
Local pt As PointApi
Local hWnd As Long
Local txt As String
GetCursorPos pt
hWnd = WindowFromPoint(pt.x, pt.y)
If hWnd Then
txt = txt & "X: " & Str$(pt.x) & " " & "Y: " & Str$(pt.y) & $CrLf
wTitle = String$(256, 0)
GetWindowText hwnd, ByVal StrPtr(wTitle), 256 'Get window title
wTitle = Extract$(wTitle, Chr$(0))
If wTitle = "BarLeft" Or wTitle = "BarTop" Then
Function = %True '<------------------
End If
End If
End Function
I have a problem with a library DLL offering a toolbar object which freezes the
program when the right mouse button is clicked while the cursor is over the
tool bar. There is no update available for that library, and thus I have to repair.
'
'
Select Case CbMsg
Case %WM_TIMER
Do While CursorOverToolBar()
'From here, I have to prevent the right mouse button event
'to be generated at all, just as long as the cursor
'is hoovering one of the toolbars.
''GetAsyncKeyState' does not help here.
end Do
End Select
'
'
'-------------------------------------------------------------------------------------------------------
' FUNCTION CursorOverToolBar
'-------------------------------------------------------------------------------------------------------
Function CursorOverToolBar() As Long
Local pt As PointApi
Local hWnd As Long
Local txt As String
GetCursorPos pt
hWnd = WindowFromPoint(pt.x, pt.y)
If hWnd Then
txt = txt & "X: " & Str$(pt.x) & " " & "Y: " & Str$(pt.y) & $CrLf
wTitle = String$(256, 0)
GetWindowText hwnd, ByVal StrPtr(wTitle), 256 'Get window title
wTitle = Extract$(wTitle, Chr$(0))
If wTitle = "BarLeft" Or wTitle = "BarTop" Then
Function = %True '<------------------
End If
End If
End Function
Comment