WM_LBUTTONDBLCLK not being sent?
-
I have a CWnd derrived window class and I have added handlers for WM_LBUTTONDBLCLK, WM_LBUTTONDOWN and WM_LBUTTONUP. However, OnLButtonDblClk() does not appear to be called when I double-click the window but the OnLButtonDown and OnLButtonUp handlers work OK. I have tried adding CS_DBLCLKS when creating (although this should not be necessary) but it still doesn't work. Any thoughts as to why this should be or what I could try? Thanks Tony
-
I have a CWnd derrived window class and I have added handlers for WM_LBUTTONDBLCLK, WM_LBUTTONDOWN and WM_LBUTTONUP. However, OnLButtonDblClk() does not appear to be called when I double-click the window but the OnLButtonDown and OnLButtonUp handlers work OK. I have tried adding CS_DBLCLKS when creating (although this should not be necessary) but it still doesn't work. Any thoughts as to why this should be or what I could try? Thanks Tony
-
I have a CWnd derrived window class and I have added handlers for WM_LBUTTONDBLCLK, WM_LBUTTONDOWN and WM_LBUTTONUP. However, OnLButtonDblClk() does not appear to be called when I double-click the window but the OnLButtonDown and OnLButtonUp handlers work OK. I have tried adding CS_DBLCLKS when creating (although this should not be necessary) but it still doesn't work. Any thoughts as to why this should be or what I could try? Thanks Tony
In order to know if the message is being sent, you could use the spy++ software that comes with Visual Studio. Apart from that, depending on the way you've created the handlers you could be eliminating the double click in the click handler... Imagine you are doing the capture in a PreTranslateMessage assigned function and that after the event for WM_LBUTTONDOWN you would be cancelling the rest of the message queue. Two attempts to help you. I guess that the first step is mandatory to help you to find the place where the error origines... HTH!
[www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.
-
In order to know if the message is being sent, you could use the spy++ software that comes with Visual Studio. Apart from that, depending on the way you've created the handlers you could be eliminating the double click in the click handler... Imagine you are doing the capture in a PreTranslateMessage assigned function and that after the event for WM_LBUTTONDOWN you would be cancelling the rest of the message queue. Two attempts to help you. I guess that the first step is mandatory to help you to find the place where the error origines... HTH!
[www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.
Thanks for the reply. I checked the messages being set using Spy as you suggested and the WM_LBUTTONDBLCLK was not being sent to the window. Just for a giggle, I then added CS_DBLCLKS style to the style member of the WNDCLASS when I register the window class and it then worked. I must admint that I dont really understand why this should be, because I add the CS_DBLCLKS style when I call Create later on. :~ Thanks for your help! :)
-
Thanks for the reply. I checked the messages being set using Spy as you suggested and the WM_LBUTTONDBLCLK was not being sent to the window. Just for a giggle, I then added CS_DBLCLKS style to the style member of the WNDCLASS when I register the window class and it then worked. I must admint that I dont really understand why this should be, because I add the CS_DBLCLKS style when I call Create later on. :~ Thanks for your help! :)
Nice to know it helped. ;)
[www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.
-
Thanks for the reply. I checked the messages being set using Spy as you suggested and the WM_LBUTTONDBLCLK was not being sent to the window. Just for a giggle, I then added CS_DBLCLKS style to the style member of the WNDCLASS when I register the window class and it then worked. I must admint that I dont really understand why this should be, because I add the CS_DBLCLKS style when I call Create later on. :~ Thanks for your help! :)
As you discovered, CS_DBLCLKS is a *CLASS* style, it won't work in the Window Create.