Thursday, May 02, 2024

How to call MessageBoxA using Zig in Windows

How to call MessageBoxA using Zig in Windows

OS: Windows 10 22H2
Zig: 0.12
const win = @import("std").os.windows;
extern "user32" fn MessageBoxA(?win.HWND, [*:0]const u8, [*:0]const u8, u32) callconv(win.WINAPI) i32;
pub fn main() !void {
_ = MessageBoxA(null, "world!", "Hello", 0);
}
view raw messagebox.zig hosted with ❤ by GitHub
Compile messagebox.zig:
PS C:\prj> zig build-exe messagebox.zig -lc

No comments:

How to configure nfs server on QNX 7.1

How to configure nfs server on QNX 7.1 Target: QNX 7.1 running on a VM (VMware Workstation or VirtualBox). It is assummed that the targets ...