No, no me hace lo mismo.
Creo que lo mas sencillo es replantear todo el sistema de diferenciación entre click y dobleclick.
Siguiendo la filosofía de la macro, cambia el archivo DblClK.h por este:
Código:
//----------------------------------------------------------------
#ifndef DblclkH
#define DblclkH
#include "time.h"
//----------------------------------------------------------------
#define DBLCLICK_DETECT() \
static clock_t start = clock(); \
clock_t dif = clock()-start; \
if(dif < GetDoubleClickTime() && dif > 1){ \
start = clock(); \
return; \
} \
//----------------------------------------------------------------
#endif
//----------------------------------------------------------------
Ahora el código del evento OnClick será:
Código:
void __fastcall TTexClick::Label1Click(TObject *Sender)
{
//Diferenciamos un click de un doble click incluyendo el archivo de cabecera "DblClK.h"
DBLCLICK_DETECT();
// Ahora el código del evento, siempre detrás...
Label2->Caption = "UN SOLO CLICK";
}
Y en OnDblClick:
Código:
void __fastcall TTexClick::Label1DblClick(TObject *Sender)
{
Label2->Caption = "DOBLE CLICK";
}
Lo que hace es contabilizar el tiempo que pasa entre dos clicks, si es menor que el del dobleclick del sistema lo considera doble click y abandona el evento OnClick.
Saudos