Thread: creating a button

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    Ok so now I have a start. I created a radio button (even though i want a push button), but I can't figure out how to make it open a MessageBox when clicked.

    Code:
            CreateWindowEx(NULL, "BUTTON", "", WS_VISIBLE,
                150, 150, 50,50,hwnd, (HMENU)IDC_MAIN_EDIT, g_hInst, NULL);
    It's not moving the button to where I want, or making it the correct height/width. I also don't know how to link to the MessageBox. Is that first NULL correct? What should be placed there?

    That winprog.org site was a lot of help too, thanks.

  2. #2
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158
    Quote Originally Posted by scwizzo View Post
    Ok so now I have a start. I created a radio button (even though i want a push button), but I can't figure out how to make it open a MessageBox when clicked.

    Code:
            CreateWindowEx(NULL, "BUTTON", "", WS_VISIBLE,
                150, 150, 50,50,hwnd, (HMENU)IDC_MAIN_EDIT, g_hInst, NULL);
    This creates a floating window with a button in it, not a radio button.

  3. #3
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Quote Originally Posted by scwizzo View Post
    Ok so now I have a start. I created a radio button (even though i want a push button), but I can't figure out how to make it open a MessageBox when clicked.
    ...
    It's not moving the button to where I want, or making it the correct height/width. I also don't know how to link to the MessageBox. Is that first NULL correct? What should be placed there?
    Quote Originally Posted by scwizzo View Post
    That winprog.org site was a lot of help too, thanks.
    Which of these statements is a lie?
    If you truly read through winprog.org you wouldn't have to ask such spoon-feeding questions. Sit down, read it section-by-section from top to bottom, then see how helpful it really is.

  4. #4
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    Quote Originally Posted by @nthony View Post
    Which of these statements is a lie?
    If you truly read through winprog.org you wouldn't have to ask such spoon-feeding questions. Sit down, read it section-by-section from top to bottom, then see how helpful it really is.
    Who says either of them are a lie? Quit nitpicking my ignorance. Just because I said the site was a lot of help doesn't mean it helped me accomplish something. It helped me understand how stuff works.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Creating a function pointer from a button click event?
    By dxfoo in forum Windows Programming
    Replies: 20
    Last Post: 01-29-2008, 03:35 AM
  3. creating a button without a focus rect
    By X PaYnE X in forum Windows Programming
    Replies: 0
    Last Post: 05-11-2005, 10:16 PM
  4. Creating my own button
    By minesweeper in forum Windows Programming
    Replies: 1
    Last Post: 07-19-2002, 01:38 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM