Hi Yash. Isn't each BControl message application specific? Eg. In my apps, I'd create my own message associated with each BControl (eg. 'open', 'save'), but this will always be app specific. BTW - I'm quite sure that you know that BeOS allows scripting of BMessages - have a look at Hey ( http://wiki.bebits.com/page/HeY). As far as I know, drawing commands are not sent via messages, instead the app server directly invokes hook functions - your derived BView class's method Draw(BRect..). This is different from say Win32 which sends a WM_PAINT message. Without looking at the source implementation, I'd suspect BeInc did it this way to synchronise redraws and prevent screen tearing, since the applications BHandler runs in a seperate thread, hence a lot of time may pass until your app is scheduled to receive messages, and during this time you will not actually update the screen. A hook function allows the app server to directly invoke screen updates. I hope this makes sense, otherwise I can write a lengthier explanation. Good luck. Zenja On Sat, Sep 5, 2009 at 1:32 PM, Yashasvi A.C. <yashasviac@xxxxxxxxx> wrote: > Hey guys, > > As you know, I am working on an application that catches messages in Haiku > and analyzes them. That problem was solved a while ago using the > message_print_hook() command. However, I would like to know if it was > possible to catch something on a higher level. > > Say, for example, I click on a button right now. Using the messages, I can > capture messages like _MMV, _MDN and so on. These represent the mouse > movements and clicking. However, its too low level taking the entire system > into perspective. What I am looking for is probably something like a control > command i.e. something like BTN_CLK or something when the button is clicked. > This would sort of give a higher level context on what the mouse click at > that specific location meant. > > Hopefully, that description was clear. Similarly, is there any way to > capture drawing commands? When the different components of the UI are > re-drawn continuously on the UI with a Paint() or Update() command or > something, can we capture the messages/commands that go through then? > > Thanks for all your help! > > Cheers, > Yash