Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 29th, 2006, 7:38 PM   #1
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
Making buttons respond

hello, im posting this cause i got tired of searching. Ive figured out how to make a button, but now i wanna make it like, when you click on it, it responds, like send a messagebox, or something else.
this code will create a button :

Quote:
CreateWindowEx (
0,
"button"
"Windows App",
WS_PUSHBUTTON
50,
40,
544,
375,
hwnd,
NULL,
hThisInstance,
NULL
);
Now i want to be able to click the button, so that a messagebox appears. How do i do taht?
hervens48 is offline   Reply With Quote
Old May 29th, 2006, 7:46 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Have you read any tutorials at all?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 29th, 2006, 8:21 PM   #3
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
yes i did, but none explaine.
I tried adding
if BN_CLICKED==TRUE {//execute code
}
at the end of the CreateWindow function
but it doesnt work. And thats what my win32 help files said to use.
hervens48 is offline   Reply With Quote
Old May 29th, 2006, 8:49 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Are you aware of the message-driven nature of Windows?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 29th, 2006, 8:55 PM   #5
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
Im not sure what ur saying but it would be much easier if you could just gimme the answer so i can move on. Cause im kinda stuck now, u see?
hervens48 is offline   Reply With Quote
Old May 29th, 2006, 8:56 PM   #6
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
Gah! Mate, it's not that hard to figure out. You're on the right track with BN_CLICKED. Did you download the tutorial to your hard drive and look at the source codes provided? It will tell you how to make the button work.
__________________
The world's first athletic computer geek!
The home of PrProgramsStudios
How not to post a question: <-- Please don't reply
Prm753 is offline   Reply With Quote
Old May 29th, 2006, 8:57 PM   #7
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
oh ok, ill try that.
hervens48 is offline   Reply With Quote
Old May 29th, 2006, 9:34 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
it would be much easier if you could just gimme the answer
Sometimes we do that. You don't seem to be investing much, however. Learning to research, gather, evaluate, comprehend, and use, will be invaluable (if you're planning on working at it -- if it's just play, no biggie).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC