An API and method for processing a user interface event is provided. The
user interface event may take place in any environment of a software
application, and may result from any type of user or software action. An
embodiment also provides a framework for customizing the processing of a
user interface event without the need to maintain accountability of
computer states. In the method, an application process user interface
event is processed using an operating system process. A user interface
event is received by the application process by way of a user interface.
A software component adapted to process the user interface event is
pushed onto a memory stack by the operating system process. The operating
system process processes the user interface event using the software
component, and pops the software component from the memory stack.