| View previous topic :: View next topic |
| Author |
Message |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Thu Aug 23, 2007 10:17 am Post subject: [C++]SetDlgItemText? |
|
|
ok so i just started learning win32 c++ and i want to know how to set the text of an edit box to the text of another edit box
| Code: | case WM_LBUTTONDOWN:
SetDlgItemText(hwnd,MAIN_BUTTON,HERE);
break; |
what do i set the here to?
_________________
|
|
| Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
Posted: Thu Aug 23, 2007 10:19 am Post subject: |
|
|
SetDlgItemText(hwnd,MAIN_BUTTON,"this is text");
_________________
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Thu Aug 23, 2007 10:22 am Post subject: |
|
|
yes i know that but i want to change "this is text" to the text of another editbox
_________________
|
|
| Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
Posted: Thu Aug 23, 2007 10:50 am Post subject: |
|
|
GetDlgItemText
_________________
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Thu Aug 23, 2007 10:59 am Post subject: |
|
|
i dont understand GetDlgItemText is it like this? GetDlgItemText(hwnd,MAIN_EDIT,"text",20) does it store the text i put in somewhere?
_________________
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Thu Aug 23, 2007 11:03 am Post subject: |
|
|
The third parameter holds the text of the control your specified.
_________________
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Thu Aug 23, 2007 11:11 am Post subject: |
|
|
ok so it gets the text of main_edit and it looks for "text"? if so then how do i get it to look for any text? also could you give me an example? sorry if im asking too many questions
_________________
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Thu Aug 23, 2007 11:13 am Post subject: |
|
|
| Code: | char szItemName[80];
GetDlgItemText(hwndDlg, ID_ITEMNAME, szItemName, 80) |
It retrieves the text of "ID_ITEMNAME" and store the information in szItemName.
_________________
|
|
| Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
Posted: Thu Aug 23, 2007 11:14 am Post subject: |
|
|
char buffer[256];
GetDlgItemText(hwnd, ITEM1, buffer, 256);
SetDlgItemText(hwnd, ITEM2, buffer);
_________________
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Thu Aug 23, 2007 11:15 am Post subject: |
|
|
wow thx u guys heh i didn't know u had to have a variable
_________________
|
|
| Back to top |
|
 |
|