I have a console game (DOS game) I created a wile ago to learn C++. But now I want to expand this game. So I started reading windows API tutorials. But I still need some help.

I have no idea how to create buttons, and how to make something happen when I click them (like 'if button is clicked, then clicks = clicks + 1')

I have no idea how to make if statements

and I am not sure on how to display text (like for a DOS program, I would say 'cout << "your clicks equal" <<clicks ". \n";' but what do I do for API.)


Please help.

Recommended Answers

All 5 Replies

I've already read that, and it tells me just the things I dont really need to know right now. It doesn't give me a good example of displaying text, and it doesn't say anything about if statements.

I need to be able to say:

if (money > 0) then say 'hey. you have money.'
if (money =< 0) then money = money +5 and say 'hey, I just gave you five bucks.'

thanks so much. this would really help.

I've already read that, and it tells me just the things I dont really need to know right now. It doesn't give me a good example of displaying text, and it doesn't say anything about if statements.

I need to be able to say:

if (money > 0) then say 'hey. you have money.'
if (money =< 0) then money = money +5 and say 'hey, I just gave you five bucks.'

thanks so much. this would really help.

if-statements still works the same way as console-based application.

What you need to know is how a windows application works, not how if-statement works. Windows application basically has a loop that constantly process messages. Every user actions, such as a mouse-click, a keyboard typing, a mouse movement, will generate different messages that are processed by this loop. Programmers would override the function that process these messages. This is the basis of how Win32 application works.

However, if you use Visual C++ & MFC, you can simplify these procedures because MFC provides classes and framework that wraps around the Win32 API. If you want to learn how to create windows application using Visual C++ and MFC, I suggest you grab a textbook on that because there are simply too many things to explain in a forum.

I've already read that, and it tells me just the things I dont really need to know right now. It doesn't give me a good example of displaying text, and it doesn't say anything about if statements.

I need to be able to say:

if (money > 0) then say 'hey. you have money.'
if (money =< 0) then money = money +5 and say 'hey, I just gave you five bucks.'

thanks so much. this would really help.

I just browse through the site that Aia provides. It DID tell you the things that you need to know right now, that is, to understand how a windows application works.

You need to understand that a windows application works very differently from a console application. You need to know what is a message loop, what is a window, what are controls, what are event handlers, what are windows handle, etc. And those are just the basics.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.