Log in

View Full Version : 2 questions


Anonymous
September 18th, 2003, 08:50
Is it possible to search (or break) on an indentifier id/handle?

What I mean is, I have for example a button, this button has a handle and an identifier id. Now I want to find some code that modifies something about this button (i.e. changes it's caption or enables the button). I can find the button with the view|windows "tool" but then I can't set a breakpoint on this "window/handle" so that Olly breaks when something is done with that handle/window.

And a 2nd question:
How can I break when I click on a specified button? Can I i.e. set a breakpoint on the BN_CLICKED command?

I hope that I'm clear enough with what I mean with my questions ;-)
Thanks in advance for yours anwer(s)!

P.s. sorry for the topic title, but I couldn't think of a better name for this topic on this short notice.

Anonymous
September 18th, 2003, 15:26
You can't break on handle or id, but you can set a conditional breakpoint on the function you think it's going to use and place the conditional as for looking at the stack to see what id/handle it's giving to the function. There's not that many functions that change the text or make a button enabled.

Secondly, to break on the click of a button, I'd break on the windows message (WM_COMMAND ?) and again check the commandid by looking at the stack.

Anonymous
September 19th, 2003, 10:24
Thanks for your answer!
Hmm, I was already afraid of that I couldn't break on a handle or id. But is it aslo impossible to _search_ the analysed code for this specefic handle/id? Because it is shown nice and simple as clean text to me, and if it isn't most of the time it is still hardcoded in the source, so it could be possible I guess.

And secondly: thanks, I will try to see if that's going to work!