【发布时间】:2021-08-12 05:44:04
【问题描述】:
我想从具有虚拟键盘的 Java 桌面应用程序中隐藏 hand 光标,当鼠标光标位于每个数字上时,光标将更改为 hand 样式。
我使用透明图像(.cur 文件)作为资源尝试了以下代码,但无法隐藏 hand 光标。
是否可以将手光标隐藏到这种元素上?
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
{$R 'mycursor.res'}
uses
Windows,
Messages,
SysUtils;
procedure MyShowCursor(Show: Boolean);
const
OCR_HELP = 32651;
var
xCursor: HCURSOR;
begin
if Show then
SystemParametersInfo(SPI_SETCURSORS, 0, 0, WM_SETTINGCHANGE or SPIF_UPDATEINIFILE)
else
begin
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_NORMAL);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_APPSTARTING);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_CROSS);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_HAND);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_HELP);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_IBEAM);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_NO);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_SIZEALL);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_SIZENESW);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_SIZENS);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_SIZENWSE);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_SIZEWE);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_UP);
xCursor := LoadCursor(HInstance, 'XCURSOR');
SetSystemCursor(xCursor, OCR_WAIT);
end;
end;
begin
try
MyShowCursor(False);
Sleep(15000);
MyShowCursor(True);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.
【问题讨论】:
-
我不明白 Java 应用程序和您的 Delphi 代码之间的关系。也不是你真正想做的。请解释一下。
-
@fpiette。解决了。感谢您的关注。
标签: delphi delphi-10.3-rio mouse-cursor