Klass
Jun 11th, 2000, 04:16 PM
I would like to isolate WM_LBUTTONUP & WM_LBUTTONDBLCLK from each other when capturing a mouse event on an icon in the system tray. If you notice with the LBUTTONUP I have added a Shift key to the click in order to separate but I'm not too sure if there is a way around this. Like a timed delay on the double click or something. But when I double click I get the button up command as well. Any thoughts?
******************************************************
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Result As Long
Dim MSG As Long
'the value of X will vary depending upon the scalemode setting
If Me.ScaleMode = vbPixels Then
MSG = X
Else
MSG = X / Screen.TwipsPerPixelX
End If
Select Case MSG
Case WM_LBUTTONUP '514 restore form window
If Shift = 1 Then
If blnFlashing = True Then
'Call mPopListUsers_Click
Set tsMain.SelectedItem = tsMain.Tabs(2)
Else
Call mPopListUsers_Click
Set tsMain.SelectedItem = tsMain.Tabs(1)
End If
'If blnConnected = True Then mPopListUsers_Click
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
EndFlash
End If
Case WM_LBUTTONDBLCLK '515 start/disconnect connection
If blnOnLine = False Then
Dim lngTimer As Long
Dim lngRet As Long
blnStatus = False
If Winsock1.State = sckConnected Then
mPacket.Number = TCP_DIALREQUEST
mPacket.Message = "Request Dial out connection from " & Winsock1.LocalHostName
Winsock1.SendData PacketToString(mPacket)
DoEvents
End If
If Winsock1.State = sckConnected Then
mPacket.Number = TCP_DIAL
mPacket.Message = "Dial out connection from " & Winsock1.LocalHostName
Winsock1.SendData PacketToString(mPacket)
'SetConnectedState
Else
SetDisabledState
End If
Else
If Winsock1.State = sckConnected Then
mPacket.Number = TCP_DISCONNECT
mPacket.Message = "Close dialed connection from " & Winsock1.LocalHostName
Winsock1.SendData PacketToString(mPacket)
blnOnLine = False
'SetDisconnectedState
Else
SetDisabledState
End If
End If
Case WM_RBUTTONUP '517 display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mPopupSys
End Select
End Sub
******************************************************
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Result As Long
Dim MSG As Long
'the value of X will vary depending upon the scalemode setting
If Me.ScaleMode = vbPixels Then
MSG = X
Else
MSG = X / Screen.TwipsPerPixelX
End If
Select Case MSG
Case WM_LBUTTONUP '514 restore form window
If Shift = 1 Then
If blnFlashing = True Then
'Call mPopListUsers_Click
Set tsMain.SelectedItem = tsMain.Tabs(2)
Else
Call mPopListUsers_Click
Set tsMain.SelectedItem = tsMain.Tabs(1)
End If
'If blnConnected = True Then mPopListUsers_Click
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
EndFlash
End If
Case WM_LBUTTONDBLCLK '515 start/disconnect connection
If blnOnLine = False Then
Dim lngTimer As Long
Dim lngRet As Long
blnStatus = False
If Winsock1.State = sckConnected Then
mPacket.Number = TCP_DIALREQUEST
mPacket.Message = "Request Dial out connection from " & Winsock1.LocalHostName
Winsock1.SendData PacketToString(mPacket)
DoEvents
End If
If Winsock1.State = sckConnected Then
mPacket.Number = TCP_DIAL
mPacket.Message = "Dial out connection from " & Winsock1.LocalHostName
Winsock1.SendData PacketToString(mPacket)
'SetConnectedState
Else
SetDisabledState
End If
Else
If Winsock1.State = sckConnected Then
mPacket.Number = TCP_DISCONNECT
mPacket.Message = "Close dialed connection from " & Winsock1.LocalHostName
Winsock1.SendData PacketToString(mPacket)
blnOnLine = False
'SetDisconnectedState
Else
SetDisabledState
End If
End If
Case WM_RBUTTONUP '517 display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mPopupSys
End Select
End Sub