0

I am developing a Windows Form which contains a ListBox.

Another application, running in the background sends WM_HSCROLL to the current active application which is the one i am working on. The listbox inside form is capable of receiving these messages and receives with no problem.

When i investigate by using Spy++, i see no incoming WM_HSCROLL messages to main window but if dump the messages of listbox's window handler, i see WM_HSCOLL.

My aim is to intercept this WM_HSCROLL messages. Tried to override WndProc but not worked.

Can i override child's WndProc or how can i be aware about messages listbox receives?

thanks.

sardok
  • 1,086
  • 1
  • 10
  • 19
  • If what you want to do is have your main window do something when the listbox receives a certain message, why not use an event or delegate inside the listbox code to call back into the main window? – dario_ramos Nov 09 '12 at 13:56
  • How can i know that listbox got the specific WM message? – sardok Nov 09 '12 at 14:04
  • Take a look at [this article](http://www.codeproject.com/Articles/7554/Getting-Scroll-Events-for-a-Listbox) – dario_ramos Nov 09 '12 at 14:11
  • You could PInvoke PeekMessage using the Listbox's handle – James Nov 09 '12 at 14:18

0 Answers0