Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++]Getting a line from a text box

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Thu Dec 25, 2008 3:31 pm    Post subject: [C++]Getting a line from a text box Reply with quote

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
View user's profile Send private message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Thu Dec 25, 2008 6:07 pm    Post subject: Re: [C++]Getting a line from a text box Reply with quote

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
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Fri Dec 26, 2008 6:36 am    Post subject: Reply with quote

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
View user's profile Send private message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Fri Dec 26, 2008 8:15 am    Post subject: Reply with quote

See...there are some things managed C++ is useful for. This is extremely easy using Visual C++.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri Dec 26, 2008 12:40 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Fri Dec 26, 2008 3:28 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Mon Dec 29, 2008 1:40 am    Post subject: Reply with quote

Why go through all the trouble when Windows makes it nice and easy?
Code:
FindWindowA
FindWindowEx
GetWindowText

Figure it out.
Back to top
View user's profile Send private message Visit poster's website
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Mon Dec 29, 2008 8:38 am    Post subject: Reply with quote

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
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Mon Dec 29, 2008 12:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Mon Dec 29, 2008 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites