Has anyone else ran into problems with SetCapture where the mouse pointer seems to disappear or change its zOrder to the desktop?

I am using this sample code and in the demo it works right but in my project the pointer disappears. I now have most of the code cut and pasted but still it does it on me. The only thing I can think of thats different is that I am using a control that was created at run time and in the demo it was made at design time. Would that have anything to do with it?

VB Code:
  1. 'here is the snippet that is harassing me
  2. Private Sub cShow(ByVal x As Long, ByVal Y As Long)
  3. Dim tP As POINTAPI
  4. Dim hWndDesktop As Long
  5. Dim lStyle As Long
  6. Dim lhWnd As Long
  7. Dim lParenthWNd As Long
  8.    
  9.    ' Make sure the picture box won't appear in the
  10.    ' task bar by making it into a Tool Window:
  11.    lhWnd = PopUpList.hwnd
  12.    lStyle = GetWindowLong(lhWnd, GWL_EXSTYLE)
  13.    lStyle = lStyle Or WS_EX_TOOLWINDOW
  14.    lStyle = lStyle And Not (WS_EX_APPWINDOW)
  15.    SetWindowLong lhWnd, GWL_EXSTYLE, lStyle
  16.    
  17.    ' Determine where to show it in Screen coordinates:
  18.    tP.x = x \ Screen.TwipsPerPixelX: tP.Y = Y \ Screen.TwipsPerPixelY
  19.    lParenthWNd = PopUpList.Parent.hwnd
  20.    ClientToScreen lParenthWNd, tP
  21.    
  22.    ' Make the listview a child of the desktop (so
  23.    ' it can be fully shown even if it extends beyond
  24.    ' the form boundaries):
  25.    SetParent lhWnd, hWndDesktop
  26.    
  27.    ' Show the form:
  28.    SetWindowPos lhWnd, lParenthWNd, tP.x, tP.Y, PopUpList.Width \ Screen.TwipsPerPixelX, PopUpList.Height \ Screen.TwipsPerPixelY, SWP_SHOWWINDOW
  29.      
  30.    ' Tell VB it is shown:
  31.    PopUpList.Visible = True
  32.    PopUpList.ZOrder
  33.    
  34.    ' Try to set focus:
  35.    SetFocusAPI lhWnd
  36.  
  37.    ' Capture all mouse messages.
  38.    SetCapture lhWnd
  39. End Sub