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 


[Help]SetDlgItemText?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Thu Dec 04, 2008 7:22 pm    Post subject: [Help]SetDlgItemText? Reply with quote

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

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Thu Dec 04, 2008 7:24 pm    Post subject: Re: [Help]SetDlgItemText? Reply with quote

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
View user's profile Send private message Send e-mail
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Thu Dec 04, 2008 7:26 pm    Post subject: Reply with quote

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

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Thu Dec 04, 2008 7:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kb3z0n
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 542

PostPosted: Thu Dec 04, 2008 7:32 pm    Post subject: Reply with quote

I made a window in ResEdit, and used some of your source, to launch the dialog. when injected..
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Dec 04, 2008 8:10 pm    Post subject: Reply with quote

BOOL SetDlgItemText(
HWND hDlg,
int nIDDlgItem,
LPCTSTR lpString
);

hDlg
[in] Handle to the dialog box that contains the control.
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu Dec 04, 2008 8:23 pm    Post subject: Reply with quote

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

Joined: 11 Oct 2006
Posts: 412

PostPosted: Thu Dec 04, 2008 11:58 pm    Post subject: Reply with quote

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:

HWND DlgHWND;


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

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
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