dart-windows / win32

Build Win32 apps with Dart!
https://win32.pub
BSD 3-Clause "New" or "Revised" License
735 stars 118 forks source link

ShowCursor should use BOOL bShow and pass it in as a parameter. #831

Closed user1121114685 closed 3 months ago

user1121114685 commented 3 months ago
          int ShowCursor(int bShow) => _ShowCursor(bShow);

final _ShowCursor = _user32.lookupFunction<Int32 Function(Int32 bShow), int Function(int bShow)>('ShowCursor');`


This method of hiding the mouse also does not work. It may be because this parameter is wrong. You should use BOOL bShow and pass it in as a parameter.

C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\WinUser.h

int WINAPI ShowCursor( In BOOL bShow);

Originally posted by @user1121114685 in https://github.com/dart-windows/win32/issues/313#issuecomment-2005780078

halildurmus commented 3 months ago

There is no issue with the parameter.

BOOL is defined as a struct with a single int field in the metadata:

Screenshot 2024-03-19 121316

Since this struct is marked with a NativeTypeDef attribute, we simplify it by projecting it as int for ease of use.

user1121114685 commented 3 months ago

Hi Developer, can you check why ShowCursor is not working? I passed ShowCursor(0) in dart; the mouse is not hidden!