|
-
Feb 4th, 2001, 10:55 AM
#1
Thread Starter
Junior Member
How to use GetWindowText, GetWindowTextLength, GetDlgItem.
-
Feb 4th, 2001, 01:15 PM
#2
PHP Code:
HWND hwnd;
int len;
char * text;
hwnd = GetDlgItem(hwnd_of_parent_dialog_box, ID_OF_THE_ITEM);
len = GetWindowTextLength(hwnd) + 1;
text = new char[len];
GetWindowText(hwnd, text, len);
-
Feb 4th, 2001, 03:44 PM
#3
Frenzied Member
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_box, ID_OF_THE_ITEM);
len = GetWindowTextLength(hwnd) + 1;
text = new char[len];
GetWindowText(hwnd, text, len);
delete [] text;
not sure, so I want to know
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Feb 4th, 2001, 04:01 PM
#4
Monday Morning Lunatic
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|