Creating a Win32 GUI application
Due to the Win32 API, a Windows GUI application looks different from the other example applications in this book. If you are new to this topic and want to know more about it, then you should read Programming Windows, Fifth Edition, by Charles Petzold, Microsoft Press. You can find the book at http://www.informit.com/store/programming-windows-9780735692633.
The example application utilizes two fibers to draw rectangles and ellipses in two parts of the window screen. Due to the fiber-based approach, this is easy. The alternative is to use a timer event or separate threads, but this requires more coding. The Windows GUI application that you will create now looks as follows:
There is no special template for Win32 applications in dub
. You can create a minimal project as follows:
$ dub init winclient --type=minimal
The generated dub.sdl
file must be changed. The default main()
function cannot be used—you have to specify the VibeCustomMain
version. This is true for...