Suppressing default popup menu on a text box

VB Code:
  1. Private Declare Function LockWindowUpdate Lib "user32" _
  2. (ByVal hwndLock As Long) As Long
  3.  
  4. Private Sub TextBox_MouseDown(Button As Integer, Shift As Integer, _
  5. X As Single, Y As Single)
  6.     If Button = vbRightButton Then
  7.         ' Avoid the 'disabled' gray text by locking updates
  8.         LockWindowUpdate TextBox.hwnd
  9.        
  10.         ' A disabled TextBox will not display a context menu
  11.         TextBox.Enabled = False
  12.        
  13.         ' Give the previous line time to complete
  14.         DoEvents
  15.        
  16.         ' Display our own context menu
  17.         PopupMenu mnuPopup
  18.        
  19.         ' Enable the control again
  20.         TextBox.Enabled = True
  21.        
  22.         ' Unlock updates
  23.         LockWindowUpdate 0&
  24.     End If
  25. End Sub