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?
|
Posted: Tue Aug 21, 2007 3:35 pm Post subject: Reading editboxes text? |
|
|
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 |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Tue Aug 21, 2007 5:07 pm Post subject: |
|
|
WM_GETTEXT
|
|
Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue Aug 21, 2007 5:09 pm Post subject: |
|
|
GetWindowText is WM_GETTEXT- it does the ugly typecasting for you.
|
|
Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 21, 2007 7:41 pm Post subject: |
|
|
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 |
|
 |
nog_lorp Grandmaster Cheater
Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Tue Aug 21, 2007 8:06 pm Post subject: |
|
|
"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 |
|
 |
Ksbunker Advanced Cheater
Reputation: 0
Joined: 18 Oct 2006 Posts: 88
|
Posted: Tue Aug 21, 2007 8:38 pm Post subject: re: |
|
|
GetDlgItemText
|
|
Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 21, 2007 9:37 pm Post subject: |
|
|
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 |
|
 |
|