How to reimplement Win32 MAKEINTRESOURCE macro in Zig

Hello @Skarsh, welcome to the forum.

While LPCWSTR declaration remains the same, zig type system is not going to let you have a misaligned value.
You can use MAKEINTRESOURCEA with LoadCursorA, and use LoadCursorW when you have a string name.

Please note that there are windows bindings automatically generated from windows metadata

There was a similar issue with HWND_TOPMOST passed as a pointer with value -1:

2 Likes