发送双击列表视图(C ++,不.NET!) [英] Send a double click to a listview (c++, not .net!)

查看:176
本文介绍了发送双击列表视图(C ++,不.NET!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想送双击列表视图。从我在MSDN上阅读看来我得发送WM_NOTIFY消息和一些与NM_DBLCLK。但我不明白,真的很好藿来实现它。我已经与SendMessage函数工作之前,但MSDN是不是就如何填补结构和明确的这样:

I want to send a double click to a listview. From what I've read on msdn it seems I gotta send a WM_NOTIFY message and something with NM_DBLCLK. But I do not understand really well hwo to implement it. I've worked with SendMessage before but MSDN is not that clear on how to fill the structs and so:

http://msdn.microsoft.com/en-us/library/bb775583 (VS.85)的.aspx
NM_DBLCLK http://msdn.microsoft.com/en-us/library/bb774867(VS.85)的.aspx

WM_NOTIFY http://msdn.microsoft.com/en-us/library/bb775583(VS.85).aspx NM_DBLCLK http://msdn.microsoft.com/en-us/library/bb774867(VS.85).aspx

推荐答案

我怀疑你会走上错误的轨道。可能发送双击消息,最好的办法就是派两个单次点击,点击后立即对方。这有工作,也就不足为奇通过双击通知应用程序出了蓝色的最好机会。

I suspect you are going down the wrong track. Probably the best way to send a double click message is to send two single clicks, one immediately after the other. This has the best chance of working and not surprising the app with a double click notification out of the blue.

如果您希望将通知发送给父窗口,那么这可能让你开始:

If you want to send the notification to the parent window, then this might get you started:

NMITEMACTIVATE activate={0};
activate.hdr.hwndFrom = hWnd; // of the list view control
activate.hdr.idFrom = id; // of the list view control
activate.hdr.code = NM_DBLCLK;

activate.iItem = iItem; // the id of the list item to click
activate.iSubItem = iSubItem;
activate.ptAction = ptAction; // where the event occurred

::SendMessage(hWndParent, WM_NOTIFY, id, reinterpret_cast<LPNMITEMACTIVATE>(&activate));

这篇关于发送双击列表视图(C ++,不.NET!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆