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 


[C++]Radio Buttons and disabling controls

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Mar 19, 2008 8:33 am    Post subject: [C++]Radio Buttons and disabling controls Reply with quote

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

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Mar 19, 2008 8:40 am    Post subject: Re: [C++]Radio Buttons and disabling controls Reply with quote

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
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Mar 19, 2008 12:17 pm    Post subject: Reply with quote

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. Surprised



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Mar 19, 2008 4:01 pm    Post subject: Reply with quote

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. Smile

_________________
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Thu Mar 20, 2008 7:55 pm    Post subject: Reply with quote

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
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