Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How do i send a WM_CLICK message to a listctrl?
I am trying to do it as follows, but this doesn't work.

C++
NMHDR hdr;
hdr.hwndFrom = this->m_hWnd;
hdr.code = NM_CLICK;
hdr.idFrom = ??;
m_List1.SendMessage(WM_NOTIFY, 0, (LPARAM)



I also tried like this

C++
m_List1.SendMessage(NM_CLICK,0,0);


I want first Item get clicked of list ctrl automatically.
The functionality is such that List of second list control gets filled up by pressing
item of first list control.And requirement is such that ,first item of first Listcotrol gets clicked automatically.

Extra information:
There is one list control in which patient names are displayed,after clicking particular patient details of that patient are filled up in second list box.
now requirement is such that as soon as dialog is displayed (list control gets filled up) first patient gets clicked and details get filled.

Also there are different search criterias so the patient is not fixed.
Posted
Updated 8-Aug-12 3:26am
v5
Comments
Richard MacCutchan 8-Aug-12 8:04am    
NM_CLICK is a notification message sent from a list control to its parent window.

Try giving a bit more information on what problem you are trying to solve.
Kenneth Haugland 8-Aug-12 8:13am    
Please dont shout!! Remove the caps lock!
[no name] 8-Aug-12 8:23am    
Screaming at people is pretty much a sure fire way to get ignored.
Prasad_Kulkarni 8-Aug-12 8:46am    
Be courteous and DON'T SHOUT.

Everyone here helps because they enjoy helping others, not because it's their job.

Using all capitals means SHOUTING on web, and using all small letters means childish. Always use proper capitalization.

Remove shouting.
adityarao31 8-Aug-12 10:30am    
Thank you very much for telling me that I was totally unaware of the fact

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900