 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Mar 19, 2008 8:33 am Post subject: [C++]Radio Buttons and disabling controls |
|
|
I have 2 problems, when I send WM_ENABLE to the control, it turns gray but I can still write to the text box and focus and if the control style is WS_DISABLED, then when I send WM_ENABLE I can focus the control.
Another problem is with radio buttons, it sends WM_COMMAND but it doesn't check the radio button...
And what should I do: code the window using win32 APIs (CreateWindowEx, RegisterClassEx, etc..) or should I use resources for my window?
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Mar 19, 2008 8:40 am Post subject: Re: [C++]Radio Buttons and disabling controls |
|
|
| Symbol wrote: | I have 2 problems, when I send WM_ENABLE to the control, it turns gray but I can still write to the text box and focus and if the control style is WS_DISABLED, then when I send WM_ENABLE I can focus the control.
Another problem is with radio buttons, it sends WM_COMMAND but it doesn't check the radio button...
And what should I do: code the window using win32 APIs (CreateWindowEx, RegisterClassEx, etc..) or should I use resources for my window? |
Dunno bout the WM_ENABLE... you could try the EnableWindow API...
Radio buttons... if you mean getting the check state.
| Code: | if ( SendDlgItemMessage( hWnd, DlgId, BM_GETCHECK, 0, 0 ) == BST_CHECKED )
{
// do your stuff
}
if ( SendDlgItemMessage( hWnd, DlgId, BM_GETCHECK, 0, 0 ) == BST_UNCHECKED )
{
// do your stuff
} |
to change the status of a checkbox use BM_SETCHECK as the message and WPARAM has to be BST_CHECKED or BST_UNCHECKED
_________________
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Mar 19, 2008 12:17 pm Post subject: |
|
|
Nope, EnableWindow doesn't use the control ID, it uses the hwnd, so I'll have to make a long list of HWND variables... there must be another way to disable focus too.
And I don't want to get the check state, when I click the radio button, it sends WM_COMMAND but its not checked.
My DLL is attached, inject into Icy Tower (1.3.1 only) and see what I'm talking about.
Edit: | lurc wrote: | | to change the status of a checkbox use BM_SETCHECK as the message and WPARAM has to be BST_CHECKED or BST_UNCHECKED |
Probably didn't read this part, thanks, gonna check it.
Oh and, does anyone know how do I add XPManifest to my application? I googled but it finds random results.
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Mar 19, 2008 4:01 pm Post subject: |
|
|
set the dwStyle to BS_AUTORADIOBUTTON or w/e make sure its the oen with the AUTO in front of it.
Auto makes it check when u click it.
_________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Thu Mar 20, 2008 7:55 pm Post subject: |
|
|
Of course you will need a bool. If you do not want to use AUTO... you can manually set it by sending a BM_SETCHECK message.
Create a resource file with your whatever you are using with the manifest in it and then link it to the executable. However, if it's a DLL it will take on the manifest of the executable it's injected into.
_________________
|
|
| 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
|
|