Buttons

I am making a windows application and i can't find a way to destroy a button by pressing another button and to close the program by pressing the button.

Thank you for the help in advance.

P.S. yes i did search it online and yes i did read a lot of tutorial books but can't find the answer anywhere.
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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <conio.h>

using namespace std;

char keypress()
{
    char key = 127;
	key = _getch();
	if (key == 0 || key == -32)
	{
		key = _getch();
        if (key == 27) // escape key
        {
            return 0;
        }
	}
	return key;
}

int main()
{
    std::cout << "test" << endl;
    keypress();
}
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.
Yea but i don't know how to do any of that. I am kinda new to making windows apps. I know how to do it on console cause i was doing it a lot. Windows programing is something new to me and hard.
Unfortunately i don't have the money to buy the books but i will take a look at the free online tutorials, thanls.
Registered users can post here. Sign in or register to post.