15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CListCtrl, WM_LBUTTONUP message handler

Uma Shankar -- Uma_Shankar@countrywide.com
Tuesday, March 26, 1996

Config :Win NT, VC++ 4.0
hi all,

I got a message handler for WM_LBUTTONUP message in CListCtrl derived class(in 
Report format).  I am expecting this message handler to be called when the user 
releases the mouse on the list control.  Unfortunately this is not happening.  
I checked with spy for the mouse messages on the list control.  It shows 
WM_LBUTTONUP message.

The actual application is like this.  I am simulating Drag and Drop in my 
Dialog.  The dialog got  2 controls.  One is QListcontrol and the other is tree 
control (QTTree Class which is derived from CTreeCtrl).  I got to drag an item 
from the tree control the  to list control.   Tree control sends a parent 
notification message TVN_BEGINDRAG, if the user drags an item .  In that 
message handler ( i mean in QDialog class), i am getting the item to be dragged 
and also i am capturing the mouse.  I am expecting the WM_LBUTTONUP message in 
QListCtrl after this, such that i can drop the item in list control and Release 
the Mouse..  This is not working.  

I tried cliking on the list control ,  ( I did't touch tree control.. So dont 
bother about mouse capture), just to check the message handler of QListCtrl.  
The message handler  in  QListCtrl for WM_LBUTTONUP message is getting called 
on the double click event, but not single click.

I will be greatful, if you can suggest any other way of doing this as well.. 

thanks in advance..


Uma shankar




Anil Kumar. K -- pushpak@m-net.arbornet.org
Monday, April 01, 1996

Hi,
	Since you are capturing the mouse in the TVN_BEGINDRAG handler
you cannot expect the list control to recieve the WM_LBUTTONUP message. =
What you can do is, at the dialog level, in the TVN_BEGINDRAG handler, =
the dialog can capture the mouse. In the WM_LBUTTONUP handler, the =
dialog can check in which control the mouse was released and take the =
appropriate action.
	This is what I have also done and it is working fine. But I do not =
know, if this is the best way to handle drag-n-drop across controls. =
Infact, I had sent a message asking, where could this be handled; at the =
dialog level or at the control level. Unfortunately, I didn't recieve =
any reply for that. Hope that question also gets answered now.

Thanks,
Anil Kumar .K


----------
From: 	Uma Shankar[SMTP:Uma_Shankar@countrywide.com]
Sent: 	Tuesday, March 26, 1996 3:09 PM
To: 	mfc-l
Subject: 	CListCtrl, WM_LBUTTONUP message handler

Config :Win NT, VC++ 4.0
hi all,

I got a message handler for WM_LBUTTONUP message in CListCtrl derived =
class(in=20
Report format).  I am expecting this message handler to be called when =
the user=20
releases the mouse on the list control.  Unfortunately this is not =
happening. =20
I checked with spy for the mouse messages on the list control.  It shows =

WM_LBUTTONUP message.

The actual application is like this.  I am simulating Drag and Drop in =
my=20
Dialog.  The dialog got  2 controls.  One is QListcontrol and the other =
is tree=20
control (QTTree Class which is derived from CTreeCtrl).  I got to drag =
an item=20
from the tree control the  to list control.   Tree control sends a =
parent=20
notification message TVN_BEGINDRAG, if the user drags an item .  In that =

message handler ( i mean in QDialog class), i am getting the item to be =
dragged=20
and also i am capturing the mouse.  I am expecting the WM_LBUTTONUP =
message in=20
QListCtrl after this, such that i can drop the item in list control and =
Release=20
the Mouse..  This is not working. =20

I tried cliking on the list control ,  ( I did't touch tree control.. So =
dont=20
bother about mouse capture), just to check the message handler of =
QListCtrl. =20
The message handler  in  QListCtrl for WM_LBUTTONUP message is getting =
called=20
on the double click event, but not single click.

I will be greatful, if you can suggest any other way of doing this as =
well..=20

thanks in advance..


Uma shankar




| Вернуться в корень Архива |