Eleventh post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in
procedural* programming mode with Visual Studio 2022.
About Tutor_11This tutor introduces the use of a TOAST window to notify the user about a specific event.
It pops up from the bottom right edge of a parent window, and auto-hides itself after 15 secondes.
This project uses 2 GDImage controls:
The first, is a child window working in DWM transparent mode, using the whole client area to display a helper message.
The second, is a popup child window (the Toast window).
ZI_DwmEnableThis API enable the DWM transparent mode for a specific window (Main and Toast).
ZI_CreateImageCompositedThis API is used to create on the fly a composited image from multiple object layers,
they are defined first in a ZOBJECT array using any GDImage object type.
The z-order composition will match the array order, the lower indice at the bottom, the higher on top.
All layers are composited in memory, then saved to file into the temporary folder.
ZI_CreateWindowFromImageThis API creates the Toast window. It uses the magenta color, or the alpha channel to build a region on the fly.
In the example we use the previously saved composited image from the temporary folder.
The width/height of a Toast window is computed to fit the size of the text message.
Last but not least,
the size of the standalone binary EXE is only
15 Kb.
*
procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.