I would say "Application", or "Service", depending on whether or not there is a GUI or not.
How is it possible to do something
like that
Since you tagged your question with C++, I'll assume you want to use C++ to build a windows application, like Microsoft Word or Excel?
You could download the free Microsoft Visual Studio C++ Express, read some tutorials, buy a book, and start to learn how to write applications. An application like Excel was written over a period of over twenty years, by a team of thousands of developers.
There are many different ways to write Applications for Windows, and many people use languages other than C++ to write these, although C++ is certainly very popular for commercial applications, and I believe Excel and Word are written in a mix of C++ and C.
Here on StackOverflow I count over two dozen different languages used to write applications for Windows, including Python, C++, Java, Delphi, and many many more.
The main structure of such an application looks like this, in python-like-pseudo-code, not very different from the other answer's C-like-code:
initialize_things()
while (!AreWeStoppingYet) :
event = GetAnEvent()
ProcessAnEvent(event)
Sometimes this little loop above is part of a "framework" as someone else said. In other words, I never actually write this code myself, I have it written for me. I use Delphi a lot, and this little loop is part of a little object called Application. On many frameworks, including Delphi, and some C++ frameworks, this loop is buried somewhere in the source code for your framework, and you might not even really think about the fact that it is there.