I'm trying to use mouse events from a subclassed static control in my program, but none of them seem to be reaching my Window Procedure function. I've placed a call to MessageBox after checking for each message type, but nothing happens no matter what I do with my mouse when the program is running. I even moved the code to my parent window's Window Procedure function to see if that's where they were being sent, but still nothing happened. On the other hand, I can capture mouse events generated by my parent window with no problem at all. Is there something I'm missing about the static control or what?

Posted on 2004-09-08 00:56:34 by Sparafusile
But from the MSDN:

Although static controls are child windows, they cannot be selected. Therefore, they cannot receive the keyboard focus and cannot have a keyboard interface. A static control that has the SS_NOTIFY style receives mouse input, notifying the parent window when the user clicks or double clicks the control...

Can you be specific about what you whish to adchieve: "Hot" tracking?

Also are you exiting your subclassed procedure correctly? If you handle the msg are you ending it or are you forwarding the msg to the original window procedure?

Can you post some code... maybe you are responding to the wrong messages.
Posted on 2004-09-08 01:30:29 by Black iCE
I'm displaying a list of thumbnail images side by side in a static control. I want to allow the user to click on one or more of the images in order to drag and drop them imto differant places in the list. Is there a better component I should be using for this purpose?

I'm sorry, I don't have any source code for you since I'm writing this in C. I'm asking my question on this board so I don't have to deal with the idiots that plague the other boards.

Posted on 2004-09-08 13:32:20 by Sparafusile
try using listview control for images container. i remember there was some implementation of item drag and drop in listview.
Posted on 2004-09-08 14:19:56 by arafel
I've done some more work on this and have come to the conclusion that I can not get any WM_LBUTTONUP, WM_LBUTTONDOWN, WM_MOUSEMOVE, etc events from a child component of a dialog box. I've tried using static controls, buttons, list views, and everything else. I did a search for this problem in Google and it came up with some examples to get around this that are written with MFC. The examples use the PreTranslateMessage method to redirect mouse events to the child component. Is there anything I can do like this without having to resort to MFC?

Posted on 2004-09-09 14:35:26 by Sparafusile
Actualy I just figured it out. If you handle the WM_NCHITTEST in a subclassed static component and return HTCLIENT (instead of the default HTTRANSPARENT) all mouse events will be forwarded to the component itself instead of the parent window. Hopefuly this will help other people with this problem.

Posted on 2004-09-09 14:49:32 by Sparafusile