| View previous topic :: View next topic |
| Author |
Message |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Thu Dec 25, 2008 3:31 pm Post subject: [C++]Getting a line from a text box |
|
|
I want to be able to get the current line from the textbox when the enter key is pressed. I know how to use SendMessage with EM_GETLINE, but I'm not sure how to set it up.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Thu Dec 25, 2008 6:07 pm Post subject: Re: [C++]Getting a line from a text box |
|
|
| HornyAZNBoy wrote: | | I want to be able to get the current line from the textbox when the enter key is pressed. I know how to use SendMessage with EM_GETLINE, but I'm not sure how to set it up. |
| Code: |
StringSplit(string str, string delim, vector<string> results)
{
int cutAt;
while( (cutAt = str.find_first_of(delim)) != str.npos )
{
if(cutAt > 0)
{
results.push_back(str.substr(0,cutAt));
}
str = str.substr(cutAt+1);
}
if(str.length() > 0)
{
results.push_back(str);
}
}
|
Thats all I can think of. I don't use C++
_________________
CEF will always stay alive. |
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Fri Dec 26, 2008 6:36 am Post subject: |
|
|
Thanks I'll give it a try.
EDIT
I got it, I just have to use WM_SETHOTKEY to get when the enter key is pressed.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
nwongfeiying Grandmaster Cheater
Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Fri Dec 26, 2008 8:15 am Post subject: |
|
|
| See...there are some things managed C++ is useful for. This is extremely easy using Visual C++.
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Fri Dec 26, 2008 12:40 pm Post subject: |
|
|
| nwongfeiying wrote: | | See...there are some things managed C++ is useful for. This is extremely easy using Visual C++. |
Not useful for anything.
|
|
| Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Fri Dec 26, 2008 3:28 pm Post subject: |
|
|
| nwongfeiying wrote: | | See...there are some things managed C++ is useful for. This is extremely easy using Visual C++. |
Managed still sucks.
_________________
Blog
| Quote: | Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that |
|
|
| Back to top |
|
 |
talkerzero Grandmaster Cheater
Reputation: 1
Joined: 24 Jul 2008 Posts: 560 Location: California
|
Posted: Mon Dec 29, 2008 1:40 am Post subject: |
|
|
Why go through all the trouble when Windows makes it nice and easy?
| Code: | FindWindowA
FindWindowEx
GetWindowText |
Figure it out.
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Mon Dec 29, 2008 8:38 am Post subject: |
|
|
| talker0 wrote: | Why go through all the trouble when Windows makes it nice and easy?
| Code: | FindWindowA
FindWindowEx
GetWindowText |
Figure it out. |
I only need to get 1 line, and I already got it.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
talkerzero Grandmaster Cheater
Reputation: 1
Joined: 24 Jul 2008 Posts: 560 Location: California
|
Posted: Mon Dec 29, 2008 12:53 pm Post subject: |
|
|
| HornyAZNBoy wrote: | | talker0 wrote: | Why go through all the trouble when Windows makes it nice and easy?
| Code: | FindWindowA
FindWindowEx
GetWindowText |
Figure it out. |
I only need to get 1 line.. |
That gets 1 line. FindWindowA to get handle on parent window, FindWindowEx to get handle on edit control, and GetWindowText to get its text..
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Mon Dec 29, 2008 2:08 pm Post subject: |
|
|
| talker0 wrote: | | HornyAZNBoy wrote: | | talker0 wrote: | Why go through all the trouble when Windows makes it nice and easy?
| Code: | FindWindowA
FindWindowEx
GetWindowText |
Figure it out. |
I only need to get 1 line.. |
That gets 1 line. FindWindowA to get handle on parent window, FindWindowEx to get handle on edit control, and GetWindowText to get its text.. |
| HornyAZNBoy wrote: | | I want to be able to get the current line from the textbox when the enter key is pressed. I know how to use SendMessage with EM_GETLINE, but I'm not sure how to set it up. |
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
|