Help with the butten!!!

I need to know hot to make a butten in a win32 program.
Dot you have eny ideas?

thanks for replys!
Last edited on
I've got this idea where we would selectively breed dogs with the smallest legs, then the ones with the smallest legs of their litter, and so on and son on over a very long period of time, and in the end we would have a sort of worm-like dog creature.
im toking obout a buton not dogs!
Last edited on
I love that "Reported" button.
you know that I,m tolking About a button in a win32 program!!!
I only just noticed it's quite a snazzy feature isn't it.

Hi ty98 I can't help but you might have more luck getting an answer for this is you post it in the Windows Programming section.
fixed it!
what wer you tolking obout with the dogs and stuf?
1
2
3
4
5
6
7
HWND hButton = CreateWindow ("button", "This is a button", WS_CHILD | WS_VISIBLE, 5, 5, 130, 20, hParent, (HMENU) hmControlID, GetModuleHandle (NULL), NULL);
if (!hButton)
{
MessageBox (hParent, "Button creation has failed!", "Error!", MB_OK | MB_ICONWARNING);
PostQuitMessage (0);
}
ShowWindow (hButton, SW_SHOW);


See http://www.winprog.org/tutorial/controls.html
Last edited on
is there eny thing els that i need to do in order to get this right?
Last edited on
ok I tryed that it dose not werk.
can you give me a project using that?
That will work. You just need to search how it works and not just copy and paste it in and compile it.

You most likely got errors on no hParent variable, and no hmControlID variable.

hParent is a window handle to the parent window.

hmControlID will be an integer that will represent this button. If we click the button it will fill the MSG structure with:

MSG.message = WM_COMMAND
MSG.wParam = hmControlID

That way we can handle the button clicks in a WM_COMMAND case statement.

I HIGHLY suggest reading the Win32 tutorials in this thread: http://cplusplus.com/forum/beginner/38982/

It will teach you everything you will want to know about the Win32 API.
Here's something you can copy and paste. http://zetcode.com/tutorials/winapi/controls/
Copying and pasting example code is good because it is faster, but I don't suggest it because the bad outweighs the good; If you copy and paste it then you don't remember it as well as if you typed it out. Every time I've copy and pasted code I found myself going back and having to type it out relearning the code.

So in my opinion, I highly suggest not copying and pasting code.
that is what i did. I typed it but it did not werk!
+1 quirkyusername while unrelated to this topic, that is one of the funniest things I have ever read :P
Topic archived. No new replies allowed.