 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Jun 25, 2008 7:57 pm Post subject: |
|
|
CreateThread and ExitThread
Code Snippet: (Sorry if there are errors, because im typing it from scratch)
| Code: | void FreezeValue( HWND hWnd )
{
while ( IsDlgButtonChecked( hWnd, ID_CHECKBOX1 ) == BST_CHECKED )
{
DWORD dwWeight = (DWORD)(GetDlgItemInt( hWnd, WEIGHT_EDIT, NULL, FALSE ) );
// You should probably declare your Weight variable globally so you can just do:
// *(DWORD*)dwWeight = ...
Sleep( 50 );
}
ExitThread( 0 );
}
LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
//...
case WM_COMMAND:
switch ( LOWORD(wParam) )
{
case ID_CHECKBOX1:
if ( IsDlgButtonChecked( hWnd, ID_CHECKBOX1 ) == BST_CHECKED )
CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)FreezeValue, hWnd, 0, 0 );
break;
}
break;
//...
} |
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Wed Jun 25, 2008 8:05 pm Post subject: |
|
|
This crap pisses me off because i released the source to my valuereader.dll that has a prime example of this...
_________________
|
|
| Back to top |
|
 |
Drops Advanced Cheater
Reputation: 0
Joined: 22 Feb 2008 Posts: 62
|
Posted: Wed Jun 25, 2008 8:17 pm Post subject: |
|
|
| blankrider wrote: | | This crap pisses me off because i released the source to my valuereader.dll that has a prime example of this... |
Sorry, I was originally lead to your source to see how the pointer reads values (didn't realize you had that) I don't play maplestory, so I didn't really use it
Thanks for the code snippet lurc. Is IsDlgButtonChecked faster than doing SendMessage? Also, it probably takes up a lot of CPU if I'm doing like 5 threads at once, is there a more efficient way?
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Jun 25, 2008 8:36 pm Post subject: |
|
|
| Drops wrote: | | blankrider wrote: | | This crap pisses me off because i released the source to my valuereader.dll that has a prime example of this... |
Sorry, I was originally lead to your source to see how the pointer reads values (didn't realize you had that) I don't play maplestory, so I didn't really use it
Thanks for the code snippet lurc. Is IsDlgButtonChecked faster than doing SendMessage? Also, it probably takes up a lot of CPU if I'm doing like 5 threads at once, is there a more efficient way? |
I'm pretty sure IsDlgButtonChecked just looks like this:
| Code: | UINT IsDlgButtonChecked( HWND hWnd, int nIDButton )
{
return (UINT)SendDlgItemMessage( hWnd, nIDButton, BM_GETCHECK, 0, 0 );
} |
I just used it because i didn't feel like adding anything else or typing out SendMessage lol.
What i usually do is just make a macro using #define like so:
| Code: | | #define GetCheck(hWnd,Id) SendDlgItemMessage( (HWND)(hWnd), (int)(Id), BM_GETCHECK, 0, 0 ); |
So you could just do:
| Code: | | if ( GetCheck( hWnd, ID_CHECKBOX1 ) == BST_CHECKED ) |
And Threads are probably the only safe way. So you'll have to sacrifice your CPU for a couple threads.
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|