| View previous topic :: View next topic |
| Author |
Message |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Sun Aug 31, 2008 8:30 pm Post subject: CheckBox Issue |
|
|
Well, the hotkey area of my bot doesn't work. I got the main functions to work, etc, but for somereason, the checkboxes won't tick when I press teh appropriate hotkey. SendMessage keeps returning 0, even when I check the box, etc. I know it enters the message loop, because I put messageboxes within case 71:. However, I'm still completely lost in how to proceed. I have no idea why this doesn't work. Afaik, this should work. It does compile, its just that nothing happens or sendmessage returns 0; Help would be appreciated.
Thank you very much,
-waffles
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Aug 31, 2008 8:40 pm Post subject: |
|
|
Try using GlobalAddAtom as the id. and then instead of looking for the id, look for the Hotkey itself. I believe its the HIWORD of lParam that holds the virtual key...
Check the return values of RegisterHotkey
btw, for GetMSWnd, or w/e that function is called, add a sleep...
_________________
|
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Sun Aug 31, 2008 8:51 pm Post subject: |
|
|
Alright, but I really don't think its the hotkey that's the issue. I put a MessageBox inside of case x: SendMessage. And when it was == BST unchecked, it put up the MBox. Ill do your fix though, and see how it goes. Thanks for the input.
EDIT: How exactly do I use atoms? I've never used them before, and aren't really sure what they are. I checked MSDN, but am not sure how they relate to identifiers.
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Aug 31, 2008 9:10 pm Post subject: |
|
|
ATOM is just a definition for WORD.
In WndProc u have WPARAM, which is your Word Param, which allows 2 bytes of space to be added. Usually wParam is used for identifying... when it comes to reading it at least.
Anyways, scratch what I said about needing GlobalAddAtom. It's really only needed within a DLL. Although it still works using it in an EXE. It has to do with making sure the identifier is within a certain range which GlobalAddAtom returns.
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Aug 31, 2008 9:13 pm Post subject: |
|
|
You're defining the handles to your controls twice, and ending up using null as a handle when you try to send your messages.
You're creating and assigning handles to your controls when the function executes, not using the ones you already created in the header file. So basically, your HWND's go bye bye and since you never assigned the global ones to anything... you get null.
|
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Sun Aug 31, 2008 10:55 pm Post subject: |
|
|
Wow, you are right! Thanks a ton. I love you .
|
|
| Back to top |
|
 |
|