Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

left click & hold for 3 seconds

Status
Not open for further replies.

dorum

Programmer
Aug 12, 2003
7
RO
Hi,

Please help me with this one.

I have a button on a dialog form and I need to pop-up another dialog form if someone press&hold this button
for 3-4 sec.

tkx

D.
 
Maybe it helps:

As I read in the MSDN, the owner window of the button gets with WM_COMMAND message, if a button is pushed (BN_PUSHED) or released (BN_UNPUSH).
if so in your App, you could

BN_PUSHED:
nLastTick=GetTickCount();

BN_UNPUSHED:
if ((GetTickCount()-nLastTick)>3000 /*time in ms*/){
StartTheOtherDialog();
};


I hope I could help a bit

set/reset a bool to find out whether is still pressed an at the time of each pushing get tic

Greetings Andreas
 
In the WM_LBUTTONDOWN handler set a timer

SetTimer(1, 3000);

In the WM_LBUTTONUP handler kill the timer and remove the dialog if needed.

KillTimer(1);
//Remove dialog


In the ON_TIMER handler start your dialog.


Hope this helps.
 
hi ,

It works ok now !!

// SetTimer(NULL,3000,(TIMERPROC)NULL)

10x guys

D.

 
>dorum
if post was helpful, the best thanks or 10x or Xx is a red star. You should mark it as helpful

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top