home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!tamsun.tamu.edu!tnash
- From: tnash@cs.tamu.edu (Trey Nash)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Re: Triple click - how to capture?
- Date: 25 Jan 1993 08:08:00 GMT
- Organization: Computer Science Department, Texas A&M University
- Lines: 25
- Message-ID: <1k0750INN1qf@tamsun.tamu.edu>
- References: <9302511.29120@mulga.cs.mu.OZ.AU>
- NNTP-Posting-Host: sparc71.cs.tamu.edu
-
- 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
-