Log in

View Full Version : Information requrired


peterg70
November 20th, 2001, 08:01
Guys

Whats the correct API to trap when i want to i want to break into the code when i click on button like "register" so that i can trace what it does from when i click the button

I know User32.dll:getwindowtextA and others for the text but i think i need the something for when a button is depressed

TIA
peterg70

PS finally managed to rebuild the exe for crypkey what a bloody pain but at least i have a working one.

Later on i want to add some fields on the dialog that i can type values into rather than hexing the code all the time. Is there any software that does that ?

Clandestiny
November 20th, 2001, 09:15
Hiya,

Well, in this case you'll probably want to set a Windoze message breakpoint.

Syntax in SI is "bmsg "hwnd of window / control" "message".

You first will need to get the handle of the button in question. This is easily accomplished using a tool like Windowse. It will also be helpful to get the button's ID #.

As for the specific message breakpoint, you have a couple of options. Specific mouse-click related breakpoints are a possiblity as in:

BM_CLICK
WM_LBUTTONDOWN
WM_LBUTTONUP
BN_CLICKED

Or alternately, you could just set a conditional breakpoint on WM_COMMAND if the LOWORD is equal to the ID for the button in question.

WM_COMMAND
wNotifyCode = HIWORD(wParam); // notification code
wID = LOWORD(wParam); // item, control, or accelerator identifier
hwndCtl = (HWND) lParam; // handle of control

This will break you right into the middle to the main message processing loop for the application. Basically, it'll look like a giant set of "IF" statements. And as you trace you'll be watching each of these comparisons to find out where your button ID is compared to the LOWORD(wParam). When you find this point, the following code / function call should point you to the code that is executed in response to this button having been clicked.

Regards,
Clandestiny