Results 1 to 3 of 3

Thread: How to get the EDIT?

  1. #1

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Post How to get the EDIT?

    I would like to know how to get the Value in EDIT1.

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Try this:
    PHP Code:
        int len GetWindowTextLength(GetDlgItem(dlghwndEDIT1));   
    charbuf;
    buf = (char*)GlobalAlloc(GPTRlen 1);
    GetDlgItemText(dlghwndEDIT1buflen 1);
    MessageBox(NULL,buf,"EDIT1 Text"MB_OK);        
    GlobalFree((HANDLE)buf); 
    That will work if you are using EDIT1 on a dialog box. If it's on a standard window and you know its handle, you can use the following code:

    PHP Code:
        int len GetWindowTextLength(edit1hwnd);   
    charbuf;
    buf = (char*)GlobalAlloc(GPTRlen 1);
    GetWindowText(wndhwnd,  buflen 1);
    MessageBox(NULL,buf,"EDIT1 Text"MB_OK);        
    GlobalFree((HANDLE)buf); 
    Baaaaaaaaah

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    GlobalAlloc is deprecated. Use HeapAlloc.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width