| View previous topic :: View next topic |
| Author |
Message |
kb3z0n Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 542
|
Posted: Thu Dec 04, 2008 7:22 pm Post subject: [Help]SetDlgItemText? |
|
|
First, please don't flame, because this is my first time ever using this.
Well, it doesn't seem to be working at all.
The static variable is IDC_HUD.
So i did,
SetDlgItemText(NULL,IDC_HUD,"On");
It compiles fine, but the static label doesn't change, help? |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Thu Dec 04, 2008 7:24 pm Post subject: Re: [Help]SetDlgItemText? |
|
|
| kb3z0n wrote: | First, please don't flame, because this is my first time ever using this.
Well, it doesn't seem to be working at all.
The static variable is IDC_HUD.
So i did,
SetDlgItemText(NULL,IDC_HUD,"On");
It compiles fine, but the static label doesn't change, help? |
the "NULL" you put must not be NULL, and is the HWND that contains the label you are modifying. _________________
|
|
| Back to top |
|
 |
kb3z0n Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 542
|
Posted: Thu Dec 04, 2008 7:26 pm Post subject: |
|
|
I was looking through your source, And i can't find out How, you put hWnd for the Dialog..
Like, i put hWnd instead,
and at the top i put.
HWND hWnd;
but that never helped either. |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Thu Dec 04, 2008 7:28 pm Post subject: |
|
|
| kb3z0n wrote: | I was looking through your source, And i can't find out How, you put hWnd for the Dialog..
Like, i put hWnd instead,
and at the top i put.
HWND hWnd;
but that never helped either. |
*sigh* It must be the hWnd of the window that the static text is on. The main window of your program most likely. Not one that you custom-make. _________________
|
|
| Back to top |
|
 |
kb3z0n Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 542
|
Posted: Thu Dec 04, 2008 7:32 pm Post subject: |
|
|
| I made a window in ResEdit, and used some of your source, to launch the dialog. when injected.. |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu Dec 04, 2008 8:10 pm Post subject: |
|
|
BOOL SetDlgItemText(
HWND hDlg,
int nIDDlgItem,
LPCTSTR lpString
);
hDlg
[in] Handle to the dialog box that contains the control. |
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Thu Dec 04, 2008 8:23 pm Post subject: |
|
|
if you are using this under the message function, then just pass the HWND that is passed down with the function. 2nd param is the ID, 3rd is string
pretty basic _________________
|
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Thu Dec 04, 2008 11:58 pm Post subject: |
|
|
you know where your Dialog Message Queue thread thing is..?
well you could rip the HWND there.
here is how I do it..
Global this maybe in a header file or above in your cpp file if (you plan to make it one file only).
| Code: |
BOOL CALLBACK DlgThread(HWND hDlg,UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
//save the hwnd to this to use buttons,textbox's outside the DlgThread.
DlgHWND = hDlg;
return TRUE;
}
}
|
so you use it like..
| Code: |
SetDlgItemText(DlgHWND, IDC_LASTPACKET, "On");
|
otherwise you have to use FindWindow() on your classname or whatever the title of your dialog is.
cheers _________________
|
|
| Back to top |
|
 |
|