Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MAKEPOINTS, GET_X_LPARAM, GET_Y_LPARAM macros #1194

Open
AffluentOwl opened this issue Jun 2, 2024 · 1 comment
Open

Add support for MAKEPOINTS, GET_X_LPARAM, GET_Y_LPARAM macros #1194

AffluentOwl opened this issue Jun 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@AffluentOwl
Copy link

AffluentOwl commented Jun 2, 2024

Problem

Each developer has to go out of their way to implement the MAKEPOINTS, GET_X_LPARAM, GET_Y_LPARAM macros manually when converting C++ code examples to C#. This adds one more point where bugs can be introduced, and slows down porting code due to this special case.

These are also some of the most basic and widely used macros, as they are used for handling clicks on forms. They are commonly found in Hello World Win32 examples. https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttonup

Solution

Add the macros just like the opposite macros, which already exist, to combine shorts into a single int.

Alternative

Each developer has to go out of their way to implement this macro manually when converting C++ code examples to C#.

POINTS p = new ()
{
  x = (short)lParam,
  y = (short)(lParam >> 16),
};
@AffluentOwl AffluentOwl added the enhancement New feature or request label Jun 2, 2024
@AArnott
Copy link
Member

AArnott commented Jun 3, 2024

Sounds good. Thanks for the suggestion. Are you interested in submitting a pull request, like the one you already found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants