Editline inside dialog

This is a discussion on Editline inside dialog within the Windows Programming forums, part of the Platform Specific Boards category; I have a editline inside a dialogbox, how can i transer the contents in the editline into a global character-string, ...

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    Editline inside dialog

    I have a editline inside a dialogbox,
    how can i transer the contents in the editline into a global character-string, when the user press a OK-button in the dialog?

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    When the user presses an OK-button in the dialog, a WM_COMMAND message is sent to the dialog. Handle it by grabbing the editline text into your global character-string.

    Code:
    case WM_COMMAND:
    {
      int id = LOWORD( wParam );  // get the identifier of the control
      if( id == MY_BUTTON_ID )
      {
        GetDlgItemText( hDialog, MY_EDITLINE_ID, globalBuffer, GLOBAL_BUFFER_LENGTH );
      }
      return TRUE;
    }
    [edit]

    Forgot that we're working with dialogs. Changed return 0; to return TRUE.
    Last edited by Dante Shamest; 03-11-2005 at 09:03 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  3. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 03:42 PM
  4. opening a dialog window from inside a dialog window
    By uvacow in forum C++ Programming
    Replies: 1
    Last Post: 12-02-2002, 09:27 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21