Hi, i'm learning to program in c++ for windows. Is it possible someone could make an example of a window with just a button on it? I learn best by just looking at the code and playing around with it... Thanks alot!
Hi, i'm learning to program in c++ for windows. Is it possible someone could make an example of a window with just a button on it? I learn best by just looking at the code and playing around with it... Thanks alot!
I don't suppose it crossed your mind that there may be, ohhh, hundreds of examples of small programs on the windows board?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
There are some tutorials atwinprog.org.
You can make a message box with one function, but making a program that actually runs in a window is a bit more complicated, and you'll probably need a book. Almost every Windows programmer has a copy of Programming Windows, by Charles Petzold. Beware - I was shocked when I first opened Petzold's book and saw his first "Hello Windows" example. It's almost 2 pages long, and all but 2 or 3 lines are "special" functions, structures, and constants that are defined in <windows.h>. There are thousands of functions, structures, and constants in <windows.h>, and you need a book to explain them.
[EDIT]-
If you're just learning C++, you should learn standard* text-based C++ before attempting to learn true Windows/GUI programming. On a Windows system, these text-based programs are called Windows console applications These programs run in a DOS-like Window.
*The C++ language standard doesn't include graphics, mouse input, color, or sound. All of these are system/compiler specific features.
Last edited by DougDbug; 03-15-2004 at 07:24 PM.
Ok! I finally got a button to work!! but it takes up the whole form... can someone fix that and show me what i did wrong? Thanks alot!
--edit--
lol, oh i know why it took up the whole form hehe..
-code removed-
Last edited by akrocks; 03-15-2004 at 08:09 PM.