Skip to content

SetWindowLongPtr is not generated #528

@rick-de-water

Description

@rick-de-water

Actual behavior

SetWindowLong is generated, but SetWindowLongPtr is not.

Expected behavior

SetWindowLongPtr should be generated to be able to set a pointer value on window.

Repro steps

  1. NativeMethods.txt content:
Windows.Win32.UI.WindowsAndMessaging
  1. NativeMethods.json content (if present):
    N/A

  2. Any of your own code that should be shared?

unsafe private static LRESULT WindowProcedure(HWND window, uint message, WPARAM wparam, LPARAM lparam)
{
    if (message == PInvoke.WM_CREATE)
    {
        var createStruct = (CREATESTRUCTW*)lparam.Value;
        PInvoke.SetWindowLongPtr(window, WINDOW_LONG_PTR_INDEX.GWLP_USERDATA, (IntPtr)(*createStruct).lpCreateParams);
    }

    return PInvoke.DefWindowProc(window, message, wparam, lparam);
}

Context

  • CsWin32 version: 0.1.635-beta
  • Win32Metadata version (if explicitly set by project): N/A
  • Target Framework: net6.0
  • LangVersion (if explicitly set by project): 10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions