Results 1 to 4 of 4

Thread: Get Problems

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Croatia
    Posts
    22
    How to use GetWindowText, GetWindowTextLength, GetDlgItem.
    VB, C++

  2. #2
    Guest
    PHP Code:

    HWND hwnd
    ;
    int len;
    char text;

    hwnd GetDlgItem(hwnd_of_parent_dialog_boxID_OF_THE_ITEM);
    len GetWindowTextLength(hwnd) + 1;
    text = new char[len];
    GetWindowText(hwndtextlen); 

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I don't know Dennis, but shouldn't you use delete after new?

    PHP Code:
    HWND hwnd;
    int len;
    char text;

    hwnd GetDlgItem(hwnd_of_parent_dialog_boxID_OF_THE_ITEM);
    len GetWindowTextLength(hwnd) + 1;
    text = new char[len];
    GetWindowText(hwndtextlen);
    delete [] text
    not sure, so I want to know
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yes, but only once you've finished with it . Anyway, all allocated memory is returned to the system when your program exits

    ...but that's no substitute for clearing up

    Jop -- technically you're correct
    Dennis -- couldn't be bothered
    Parksie -- shut up, you're rambling incessantly
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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