How to call MessageBoxA using Zig in Windows
OS: Windows 10 22H2Zig: 0.12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
PS C:\prj> zig build-exe messagebox.zig -lc
No comments:
Post a Comment