Thread: Wm_timer?

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Wm_timer?

    tTime=SetTimer(hWnd,NULL,5000,NULL);

    In win32, how can i explicitl kill the above timer? even though i used the KillTimer(hWnd,tTime)
    function, after 5 seconds i also got the WM_TIMER message.....

  2. #2
    Registered User dizolve's Avatar
    Join Date
    Dec 2002
    Posts
    68
    Try using an id like...

    PHP Code:
    UINT tId 1;

    SetTimer(hWnd,tId,5000,NULL);

    KillTimer(hWndtId); 

      __               &n bsp;      ___ & nbsp;       &nb sp;       &nbsp ;    
     /\ \  __    &nbs p;           /\_ \      &nbsp ;        & nbsp;     
     \_\ \/\_\  ____     _ __\//\ \    __  __&n bsp;    __   
     /'_` \/\ \/\_ ,`\  / __`\\ \ \  /\ \/\ \  /'__`\ 
    /\ \_\ \ \ \/_/  /_/\ \_\ \\_\ \_\ \ \_/ |/\  __/ 
    \ \___,_\ \_\/\____\ \____//\____\\ \___/ \ \____\
     \/__,_ /\/_/\/____/\/___/ \/____/ \/__/   \/____/
            &n bsp; I have a BAD figlet& nbsp;addiction.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Make sure the return of SetTimer does not go out of scope...if its in a Windows Procedure make it static....otherwise declare it globally

Popular pages Recent additions subscribe to a feed