Tech Support > Microsoft Windows > Development Resources > long press on button
long press on button
Posted by Sabyasachi on August 10th, 2006


Hi All,
Am creating aphone application using eVC++ 4.0 .
and i have a button.
that button's functionality is to print some 'X' character when
single click and print 'Y' when held for a long time.
but am not getting any separate event for holding the button for lets
say 2 secs.
Could anyone plz help me in this case.
i wanted to how to capture the Long press event on the button (what is
the event).
or any help how to handle this case.

thanks in advance......
Sabyasachi

Posted by Grzegorz Wróbel on August 10th, 2006


Sabyasachi wrote:
Just start measuring time on button down, then if during button up more than "let's say" 2000ms passed you'll print 'Y'.
Sounds like you're doing support for some national language, don't you?

--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D

Posted by Scott McPhillips [MVP] on August 10th, 2006


Sabyasachi wrote:
The button is not sensitive to hold-down time. You will have to ignore
the standard click event and subclass the button and add a timer to
develop your own events from the button down, button up and timer events.

--
Scott McPhillips [VC++ MVP]


Posted by Sabyasachi on August 10th, 2006


Hi Grzegorz,
Thaks for the effort.
but i just wanted to know what event it will generate when u press the
button(withoout lifting it).
i tried BUTTONUP and BUTTONDOWN but it is not coming.
so could u plz help me in telling what is the event for holding the
button down.
am into the developing of UI of one phone appliaction.
Waiting for reply

SABYASACHI

Grzegorz Wróbel wrote:

Posted by Scott McPhillips [MVP] on August 11th, 2006


Sabyasachi wrote:
WM_LBUTTONDOWN and UP are sent to the button, not to the button's parent
dialog. You probably need to learn about control subclassing, which
lets you intercept messages that are sent to the control.

--
Scott McPhillips [VC++ MVP]



Similar Posts