//
// sub_1800D8640 from 0x1800d8640 to 0x1800d8793 (339 bytes)
//
// 2 xrefs:
// > sub_1800DD5A0 @ 0x1800dd61d
// > ??> @ 0x1801c4a40
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:22:33 +0000
//
HCURSOR __fastcall sub_1800D8640(__int64 a1, int a2)
{
HCURSOR result; // rax
__int64 v5; // rcx
HCURSOR CursorW; // rax
struct tagPOINT Point; // [rsp+30h] [rbp+8h] BYREF
if ( *(HWND *)(a1 + 880) == GetActiveWindow() )
{
if ( a2 == 212995 )
{
if ( GetCursorPos(&Point) )
{
ScreenToClient(*(HWND *)(a1 + 880), &Point);
*(double *)&qword_1801B6058 = (double)Point.x;
*(double *)&qword_1801B6060 = (double)Point.y;
}
sub_1800DCF60(a1);
if ( *(_DWORD *)(a1 + 504) )
sub_1800D9990(a1);
sub_1800D9170(a1);
qword_1801B6068 = a1;
}
else
{
if ( qword_1801B6068 == a1 && *(_DWORD *)(a1 + 504) )
sub_1800D9840(a1);
ClipCursor(nullptr);
qword_1801B6070 = 0;
if ( qword_1801B6068 == a1 )
{
qword_1801B6068 = 0;
sub_1800D87A0(a1);
}
}
}
result = (HCURSOR)sub_1800D9690(a1);
if ( (_DWORD)result )
{
if ( *(_DWORD *)(a1 + 124) == 212993 )
{
v5 = *(_QWORD *)(a1 + 80);
if ( v5 )
{
return SetCursor(*(HCURSOR *)(v5 + 8));
}
else
{
CursorW = LoadCursorW(nullptr, (LPCWSTR)0x7F00);
return SetCursor(CursorW);
}
}
else
{
return SetCursor(nullptr);
}
}
return result;
}