win32 windows with buttons

I have a button class that creates a child window like this...
hButtonWnd = CreateWindow
(
TEXT("button"),
mCaption,
WS_CHILD|BS_DEFPUSHBUTTON,...etc

i want to take an action when the button is clicked. im trying to figure out how this button recieves messages. it does not have a WndProc. when the user does click in the space where the button is, no message gets send to the parent window WndProc. or at least not the WM_BUTTONUP messages taht are usually sent when a mouse button is clicked. reason why i have this class that doesnt fully work is b/c my teacher started working on it and never finished it, so all i have is code to create and show it.

The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

hey thanks man that made my life a lot easier. that's cool how easy it is to do that, i was thinking i was going to have to write a whole other wndproc. :)

edit: do you know how i could have it so that when a user right clicks on a name in my listbox i can have a small menu pop up like windows does? i understand how to realize the right click, and how to get the idx of the name selected, but how do get the menu there? is that a window class ?
also, i have an edit box class that is a child window as well. when the user types text into it, i want them to be able to push enter and have that send the text. when the edit box gets focus it sends a ID_ED_SEND_MSG message to my wndProc which i can handle in WM_COMMAND. but how can i obtain the action that the user took on that edit box? like if it is just a mouse click or if it is the enter which is what im looking for. i tried looking at the various wParam, lParam fields but none worked.

the menu has to be a pop-up. That is the items go down the menu (not across) with no header (top item you click to get the pop-up)

>> i want them to be able to push enter and have that send the text.

I would sub class the edit's WNDPROC and switch the WM_CHAR msg's.

Look for the WM_KEYDOWN, switch them looking for the VK_RETURN.

Make sure you have the ES_WANTRETURN | ES_MULTILINE style on the edit.

The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.