Thread View: comp.os.ms-windows.programmer.misc
2 messages
2 total messages
Started by Andrew Bromage
Mon, 25 Jan 1993 00:28
Triple click - how to capture?
Author: Andrew Bromage
Date: Mon, 25 Jan 1993 00:28
Date: Mon, 25 Jan 1993 00:28
11 lines
827 bytes
827 bytes
I have a Macintosh text editor which supports triple clicking to select a line. I realise that in Windows you would have to subclass an edit window to achieve the same sort of effect, except that Windows doesn't process triple clicks. Does anyone know a good to do this? Failing that, does anyone have some example code for translating double clicks which I could adapt? Thanks in advance, Andrew Bromage
Re: Triple click - how to capture?
Author: Trey Nash
Date: Mon, 25 Jan 1993 08:08
Date: Mon, 25 Jan 1993 08:08
25 lines
1835 bytes
1835 bytes
Well, there are two ways to capture a double click within Windows. The best way is to set the CS_DBLCLKS flag in the wndclass.style variable of the WNDCLASS structure. However, there is another way. Whenever you receive a WM_LBUTTONDOWN (or any other button for that matter) message, you can use the GetMessageTime function to get the time of the action. Then you can compare the intervals between the clicks to a required time to see if a double click was performed. This is the way that you would want to process the triple click that you speak of. However, one word of caution. Usually, a double click message does something in addition to the single click message. For instance, in WordPerfect for windows, the single click places the caret where you want it. The double click will highlite a word. And I believe that a triple click will highlite the sentence. You see, the functions sort of build on themselves. For instance, you would not want the single click to select the place for the caret and then the double click to paste. This is awkward and also places a burden on your mouse handling routine. The reason is that before you get that WM_LBUTTONDBLCLK message, you would also receive a WM_LBUTTONDOWN message from the first click. Just use GetMessageTime to compare the time interval from the previous click and you will be OK. Later..... -Trey
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads