Windows apps are event driven apps. An event can be an external or internal input to an app. Event driven apps run a message loop, which parses incoming events and then calls appropriate functions corresponding to that event. Code::Blocks default code generated by Win32 GUI project wizard generates a boilerplate code of an event driven app.
In order to understand event driven programming we shall be using following example to learn and understand it. We shall be using native Win32 API for this example. Win32 API is the base of several toolkits. Thus we should have an understanding of it in order to understand other toolkits.
Let's create another GUI app and name it
App10. Replace wizard generated code with the following code. Also enable Unicode support as per the steps laid out in the previous example. As the code snippet is large we'll understand and paste it in editor window in several steps.
The following code snippet shows the header declaration, global variable...