Skip to content

Instantly share code, notes, and snippets.

@mlarouche
Created February 22, 2020 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlarouche/e833711e71081ca8c3f9e647ed8ab06c to your computer and use it in GitHub Desktop.
Save mlarouche/e833711e71081ca8c3f9e647ed8ab06c to your computer and use it in GitHub Desktop.
win32 hello world
usingnamespace @import("std").os.windows;
extern "user32" fn MessageBoxA(hWnd: ?HANDLE, lpText: ?LPCTSTR, lpCaption: ?LPCTSTR, uType: UINT) callconv(.Stdcall) c_int;
pub export fn WinMain(hInstance: ?HINSTANCE, hPrevInstance: ?HINSTANCE, lpCmdLine: ?LPWSTR, nShowCmd: INT) callconv(.Stdcall) INT {
_ = MessageBoxA(null, "Zig is pretty great!", "Wow much exposure", 4);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment