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 


Reading editboxes text?

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

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 21, 2007 3:35 pm    Post subject: Reading editboxes text? Reply with quote

Heheh, well, uh, my C++ GUI tutorial never mentioned reading editboxes text. And I was going to make a crackme in C++, but I need to know how to do that. My other problem is I need to know the functions that carry out the same tasks as AnsiPos() and StringReplace()

Edit:

I can do it in a console application, but I really wanna do a windows application

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Aug 21, 2007 3:38 pm    Post subject: Reply with quote

GetWindowText
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: Tue Aug 21, 2007 5:07 pm    Post subject: Reply with quote

WM_GETTEXT
Back to top
View user's profile Send private message MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Aug 21, 2007 5:09 pm    Post subject: Reply with quote

GetWindowText is WM_GETTEXT- it does the ugly typecasting for you.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 21, 2007 7:41 pm    Post subject: Reply with quote

It says that GetWindowText is for retrieving the title bar of the window. Wait, could I put like hEdit as the handle?

Code:

string *lpBuffer[];
while(1)
{
GetWindowText(
  hEdit,
  lpBuffer,
  strlen(lpBuffer+1) /*wait am I allowed to do that(i don't think =()*/
);
}

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Tue Aug 21, 2007 8:06 pm    Post subject: Reply with quote

"It says that GetWindowText is for retrieving the title bar of the window"
Nope. GetWindowText gets the "caption" of a window. However, an editbox is a window. And its caption is its contents. So, titlebar of a Window is the same thing as the contents of an EditBox.

~nog_lorp

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
Ksbunker
Advanced Cheater
Reputation: 0

Joined: 18 Oct 2006
Posts: 88

PostPosted: Tue Aug 21, 2007 8:38 pm    Post subject: re: Reply with quote

GetDlgItemText
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 21, 2007 9:37 pm    Post subject: Reply with quote

GetDlgItemText or GetWindowText. It seems get window text would be easier feor me.

Found this code on theForgers win32 application tutorials:

Code:

    int len = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT));
    if(len > 0)
    {
        int i;
        char* buf;

        buf = (char*)GlobalAlloc(GPTR, len + 1);
        GetDlgItemText(hwnd, IDC_TEXT, buf, len + 1);

        //... do stuff with text ...

        GlobalFree((HANDLE)buf);
    }


That works right? If so, the //... do stuff with text ... part is where I would do the editing. Anyway, so if its right, what are the two functions in C++ that would do the same thing as AnsiPos and StringReplace in delphi. Because I can do it in a console, but not a window.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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