|
-
Feb 28th, 2001, 06:40 PM
#1
Thread Starter
Junior Member
How could I get the text from and edit box? Maybe put it into a string?
 Forger
As in creator, not copier.
-
Feb 28th, 2001, 07:08 PM
#2
Lively Member
Code:
GetWindowText(HWND hEdit, char* buff, int Num);
hEdit- The handle of the edit box.
buff- text is stored here
Num- maximum number of characters to write to buff.
-
Feb 28th, 2001, 08:50 PM
#3
Thread Starter
Junior Member
Thanks! Do I have to fill in NUM myself or does it automatically check how big it is?
BTW Errors:
Code:
C:\Windows\Profiles\Steve\Desktop\C c++\Win32 Using Edit Box\attempt.cpp(28) : error C2062: type 'char' unexpected
C:\Windows\Profiles\Steve\Desktop\C c++\Win32 Using Edit Box\attempt.cpp(29) : error C2065: 'buff' : undeclared identifier
Last edited by Forger; Feb 28th, 2001 at 08:55 PM.
 Forger
As in creator, not copier.
-
Feb 28th, 2001, 09:07 PM
#4
Try this...
Code:
char buffer[100];
GetWindowText(hEdit, buffer, 100);
-
Feb 28th, 2001, 11:21 PM
#5
Thread Starter
Junior Member
Thanks jake...works like a charm
 Forger
As in creator, not copier.
-
Mar 3rd, 2001, 06:03 PM
#6
Frenzied Member
You can't always use 100, if the users has typed more than 100 chars in the box you won't get them...
so be sure to first use GetWindowTextLength to know how much to grab.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
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
|