Thread: Win 32 Gui

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    15

    Win 32 Gui

    Could some post some code please.I want to press a button and display a character in an edit window.Example press a button labeled '1' and a '1' is displayed in the window .I'm using WIN32 and programming in C.Any help much appreciated

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Moved to windows forum
    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.

  3. #3
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    I'm a C++ type of guy, but this is how I do what your asking.
    In the WM_CREATE case of the switch statement, do something like...
    Code:
    CreateWindowEx(0,
                TEXT("BUTTON"),
                TEXT("1"),
                WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
                7,
                5,
                480,
                40,
                hwnd,
                (HMENU)1,
                g_hinst,
                NULL);
    Then in the WM_COMMAND case, do something like...
    Code:
    if(LOWORD(wParam) == 1){
                    if(HIWORD(wParam) == BN_CLICKED){
                                                   \\ Make it do what ever you want here
                    }
               }
    Hope this is what you were looking for


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 05-07-2009, 11:31 AM
  2. Win 32 Game Bitmap issue
    By loopshot in forum Game Programming
    Replies: 5
    Last Post: 03-02-2005, 12:55 PM
  3. help with this
    By tyrantil in forum C Programming
    Replies: 18
    Last Post: 01-30-2005, 04:53 PM
  4. Win 32
    By cgod in forum C++ Programming
    Replies: 5
    Last Post: 10-23-2004, 03:23 PM
  5. Resource ICONs
    By gbaker in forum Windows Programming
    Replies: 4
    Last Post: 12-15-2003, 07:18 AM