在 Windows 8 上使 Windows 光标变大 [英] Make the windows cursor bigger on windows 8

查看:21
本文介绍了在 Windows 8 上使 Windows 光标变大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让 Windows 光标变大.我有一个 c++ windows 应用程序,其中包含我从类似问题中劫持的以下代码.我正在从 .cur 文件加载游标.

I'd like to make the windows cursor bigger. I have a c++ windows application with the following code that I hijacked from a similar question. I am loading a cursor from a .cur file.

已经尝试过这个链接:Windows Cursor 的最大尺寸无法决定答案是不可能"还是可能".

Already tried this link: The biggest size of Windows Cursor can't decide if the answer is "impossible" or "possible".

我已经尝试过了,但它在 Windows 8 上不起作用 --> 我正在加载一个 128x128 的文件,但它看起来仍然很小 (32x32).任何人都可以发布一些真正对他们有用的东西吗?

I've tried this and it doesn't work on windows 8 --> i'm loading a 128x128 file and it still appears very small (32x32). can anyone post something that has actually worked for them?

// load cursor resource into hCursor
HCURSOR ghTouchCursor = (HCURSOR)LoadImage(NULL, L"NormalHand.cur", IMAGE_CURSOR, 0,0, LR_LOADFROMFILE);
// must copy cursor, windows is a pita...
HCURSOR ghCopyTouchCursor = CopyCursor(ghTouchCursor);
// set the cursor as the new full-screen cursor
SetSystemCursor(ghCopyTouchCursor, 32512);

我也试过像这样调用加载图像,没有区别.

i've also tried calling the load image like this, no difference.

HCURSOR ghTouchCursor = (HCURSOR)LoadImage(NULL, L"NormalHand.cur", IMAGE_CURSOR, 128,128, LR_LOADFROMFILE);

GetSystemMetrics(SM_CXCURSOR) 返回 32 但根据官方网站:"SetSystemCursor...你可以使用这个函数来设置任意大小的光标."

GetSystemMetrics(SM_CXCURSOR) returns 32 but according to the official site: "SetSystemCursor... You can use this function to set a cursor of any size."

似乎对不可能"达成了共识.

It seems like there is consensus around "impossible".

推荐答案

最大光标大小取决于系统

系统支持的光标大小(以像素为单位)可以通过调用GetSystemMetrics,使用 SM_CXCURSOR 调用 widthSM_CYCURSOR 表示高度.

The max cursor size depends on the system

The size in pixels of a cursor supported by the system can be retrieved by calling GetSystemMetrics, invoked with SM_CXCURSOR for the width, and SM_CYCURSOR for the height.

正如 msdn 所述,这是系统在创建游标时可以使用的唯一大小,这意味着如果您在调用 LoadImage 将被忽略.

As stated by msdn this is the only size the system can use when creating cursors, which means that if you are using a bigger size in your call to LoadImage that will be ignored.

如果您想要更大的光标,但系统阻止您创建光标,另一种方法是隐藏当前光标,并在光标实际所在的位置周围浮动图像.

If you want a bigger cursor, but the system prevents you from creating one, an alternative would be to hide the current cursor, and have an image float around where the cursor actually is.

这样用户会认为光标发生了变化,但实际上光标是不可见的,并且已经在其位置设置了图像.

This way the user will think that the cursor has changed, but in reality the cursor is invisible, and a image has been set in its place.

这篇关于在 Windows 8 上使 Windows 光标变大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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