I remember just how painful working with the Win32 API could be (a lifetime ago), but I felt like I really understood how it worked. These days, it's layer upon layer of abstractions. Or bindings from my language of choice to an abstraction layer/framework running on the native OS.
I couldn't begin to explain how many of the popular UI frameworks work, all the way down to the native OS layer.
There was something substantial, concrete in programming at this layer rather than some higher level, fragile abstraction.
It is funny to see people bashing it nowadays, given how I came to enjoy it.
When I started GUI coding on UNIX, Xlib, Xt and Motif on the other hand were anything but productive.
Think the UI the way I code it (declarative)
Don't have to think about screen resolution, colour depth,...
Don't have to bother with non unicode stuff
Have access to well behaved widgets
Can have portability if I need that
Even if I can't control 100% of the rendering process, my productivity has increased...
Windows Ressource files exist at least since Windows 3.x
> Don't have to bother with non unicode stuff
Just use the WinAPI functions that are prefixed with W (Unicode) instead of A (ANSI), e.g. CreateWindowExW instead of CreateWindowExA.
> Have access to well behaved widgets
Call CreateWindowEx (https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...) (yes, the name is confusing, accepted) with lpClassName value, say, of BUTTON, COMBOBOX, EDIT, LISTBOX, MDICLIENT, SCROLLBAR (for a more complete list look at the MSDN site that I linked). This creates such a widget.
In any case, OWL, VCL and later on MFC were my tools during those days, when given an option.
// #cgo CFLAGS: -DYOUR_DEFINE
// #cgo LDFLAGS: -lyourlib
// #include <header.h>
import "C"i := C.foo(C.int(j))
Assuming j is a Go int type.
Either way if you're going to build UI for Windows C#/QT with an C FFI is the more sane way to go. Back when I worked on game engines most of the time we had the fast code down in native and used C# for the tools since it's such a productive framework compared to win32.
https://github.com/LeZuse/minimal-win32-app/blob/master/main...
The C code does basically the same thing but ends up being smaller because the Go code doesn't have an equivalent of windows.h with function and data type definitions. The Go code might be a little nicer if it used a Win32 API wrapper, but there doesn't seem to be a well supported and documented one out there. This was all I could find https://github.com/AllenDang/w32.