That's sort of vague, i don't really know what you mean by it - but try this: If you press escape, the program ends without pressing enter. I don't know what you mean by "Destroy a button by pressing another button" though. This is a console application that ends if you press escape:
I am not making a console application, I am making a windows application. "Destroy a button" with that i want to make one or more buttons disapear from the screen by presing a button. By that i mean the buttons on the screen that are on the windows application (not on keyboard). It would be even better if I could just simply do something like clear screen although I don't know how to do it for windos application.
You'll need a way to get the current position of the mouse cursor every frame. Then what you can do with that is check if it is colliding with a button, and if so, you can check whether or not the user clicked. If the user clicks while the mouse cursor is within the boundary of the button, you can have it do whatever it is you want to do.