如何在mfc中获取当前游标的资源ID [英] How to get the current cursor's resource id in mfc

查看:78
本文介绍了如何在mfc中获取当前游标的资源ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从comctl32.dll加载光标我不知道该资源ID。



我可以从comctl32.dll加载光标。



但它正在创建新的游标对象。不加载标准或已加载的系统游标。



I would like to load the cursor's from comctl32.dll i don't know that resource Id.

I am able to load the cursor from comctl32.dll .

But it's creating the new cursor object. Not loading standard or already loaded system cursors.

HMODULE hmod = LoadLibrary (_T("comctl32.dll")) ;
 
HCURSOR current_cursor = ::LoadCursor ( hmod , MAKEINTRESOURCE(102) ) ;
 
ICONINFO current_cursor_icon_info ;
GetIconInfo ( ( HICON ) current_cursor , & current_cursor_icon_info ) ;
 
if ( current_cursor == current_cursor_icon_info.hCursor )
{
//Not succeeding even that cursor is the same.
}

推荐答案

我更喜欢加载光标的标准方式。它不是真正的加载,因为reosurce是缓存的,你只能得到系统句柄。



比较HCURSOR句柄是无稽之谈。 GetcursorInfo函数提供了有关它的信息。



否则你可以打开dll作为资源并获取光标的id。但它可能会改变。



最后你可以在你的项目中创建自己的资源并加载它:-O
I would prefer the standard way of loading the cursor. It is not a real loading, because the reosurce is cached, you only get the system handle.

Comparing HCURSOR handles is nonsense. The GetcursorInfo function provides info about it.

Else you can open the dll as resource and fetch the id of the cursor. But it may change.

At last you can make own resource in your projecz and load it :-O


这篇关于如何在mfc中获取当前游标的资源ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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