Microsoft KB Archive/183115

{|
 * width="100%"|

PRB: Drag List Box Does Not Send DL_DRAGGING Notification

 * }

Q183115

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)

-

SYMPTOMS
A drag list box in an improperly coded dialog box sends DL_BEGINDRAG and DL_DROPPED notifications, but no DL_DRAGGING notifications.

CAUSE
The DragList control relies on the value that is returned in response to its DL_BEGINDRAG notification in order to acknowledge the start of the drag. If this value is not returned properly, the further drag messages will not be sent.

RESOLUTION
In a Dialog Box, the value returned from the dialog box procedure is a BOOL that tells DefDlgProc whether or not the message has been handled. The returned value is not the value that is returned as the result of a sent message. To properly return a value from a dialog box procedure, the return value needs to be placed in the DWL_MSGRESULT window long position, and then TRUE must be returned from the dialog box procedure:

  case DL_BEGINDRAG: // Keep track of the item number that is being dragged. // In this case, store the number in the dialog box's     // DWL_USER position. SetWindowLong(hwnd,DWL_USER,                   LBItemFromPt(dli->hWnd,dli->ptCursor,FALSE)); // Store the return value in DWL_MSGRESULT. SetWindowLong(hwnd,DWL_MSGRESULT,TRUE); return TRUE;

STATUS
This behavior is by design.

Additional query words:

Keywords : kbCtrl kbDragList kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin

Issue type : kbprb

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch