加载默认拖放光标到我的应用程序中 [英] Loading default drag and drop cursors into my app

查看:85
本文介绍了加载默认拖放光标到我的应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的listview控件中实现拖放操作,以便我可以重新排列项目。



我想使用系统默认游标来指示何时丢弃/是不允许的。



我检查了 LoadCursor [ ^ ]功能并没有找到任何结果。



我能做的最好的相似之处发现是在不允许掉线的情况下 - > IDC_NO 与OLE拖放中的光标外观相同,但它是红色的(我在Windows 7上测试了这个)。



问题:



如何使用 LoadCursor (或类似函数)加载OLE拖放中使用的默认游标?

解决方案

如何在ole32.dll中找到游标?

光标组1包含一个黑色圆圈,其中有一条直线。

光标组6包含一个箭头,一个带有虚线轮廓的框和一个带有+的页面在它上面。



这将抓住掉落图标。

 HMODULE oleMod = LoadLibrary(  ole32.dll); 
mCursor = LoadCursor(oleMod,MAKEINTRESOURCE( 6 ));





根据Hans Passant的说法: http://stackoverflow.com/questions/3617862/custom-made-win32-drag-drop-cant-get-change-invalid-slashed-circle-cursor [ ^ ]执行* OLE * d& d时,OLE控制光标。猜测它从它自己的dll中获取它使用的游标似乎是合理的。 :)


I am trying to implement drag and drop in my listview control so I can rearrange items.

I want to use system default cursors to indicate when drop is/isn't allowed.

I have checked documentation for LoadCursor[^] function and have found nothing.

The best resemblance I could find was for the case when drop is not allowed -> IDC_NO has the same look as the cursor in OLE drag and drop, but it is red ( I have tested this on my Windows 7).

QUESTION:

How to use LoadCursor (or some similar function) to load default cursors used in OLE drag and drop?

解决方案

How about cursors found in ole32.dll?
Cursor-group 1 contains a black circle with a line through it.
Cursor-group 6 contains an arrow, a box with a dotted outline and a page with a + on it.

This will grab the drop icon.

HMODULE oleMod = LoadLibrary("ole32.dll");
mCursor = LoadCursor(oleMod, MAKEINTRESOURCE(6));



According to Hans Passant here: http://stackoverflow.com/questions/3617862/custom-made-win32-drag-drop-cant-get-change-invalid-slashed-circle-cursor[^] OLE takes control of the cursor when doing an *OLE* d&d. It seems reasonable to guess that it grabs the cursors it uses from its own dll. :)


这篇关于加载默认拖放光标到我的应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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