
If you've never experienced this problem, try it for yourself: Write a time-consuming loop that executes when a button is clicked, and try to move the form or move another window on top of it.
Delphi xe10 compiler directive windows#
So, an application performing a time-consuming operation in an event handler doesn't prevent the system from working properly (because other processes have their time-slice of the CPU), but the application generally is unable even to repaint its own windows properly-with a very nasty effect. This process is called preemptive multitasking. The first program is resumed only after each application has had a turn. In every version of Win32 (9 x, NT, Me, and 2000), after a fixed amount of time has elapsed, the system interrupts the current application and immediately gives control to the next program in the list. When an application has responded to a message and returned to a waiting state, it becomes the last in the list of programs waiting to handle additional messages.
Delphi xe10 compiler directive code#
When an application is executing event-handling code (that is, when it is not waiting for an event), other events for that application have to wait in a message queue reserved for that application (unless the application uses multiple threads). When the program has finished responding to the event, it returns to a waiting or "idle" state.Īs this explanation shows, events are serialized each event is handled only after the previous one is completed. The program code that responds to events for that window receives the event, processes it, and responds accordingly. A message describing this event is sent to the window currently under the mouse cursor. For example, when a user clicks one of the mouse buttons, an event occurs. A program spends most of its time waiting for these events and provides code to respond to them. The basic idea behind event-driven programming is that specific events determine the control flow NET Architecture from the Delphi Perspectiveĭelphi for. Web Programming with WebBroker and WebSnap Part III - Delphi Database-Oriented Architectures Modeling and OOP Programming (with ModelMaker) Part II - Delphi Object-Oriented Architectures
