Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Timer start problem

Timer start problem

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pri_skit
    wrote on last edited by
    #1

    I am drawing a screen which requires refrehing,so Invalidate() function is called continously.Now I want to start a timer when screen is drawn first time.In the timer i want to call another function which draws another screen after some time.How this could be done? I have tried to start timer but it starts only after when i Maximize 0r minimize a screen. Regards,

    priyank

    P M H 3 Replies Last reply
    0
    • P pri_skit

      I am drawing a screen which requires refrehing,so Invalidate() function is called continously.Now I want to start a timer when screen is drawn first time.In the timer i want to call another function which draws another screen after some time.How this could be done? I have tried to start timer but it starts only after when i Maximize 0r minimize a screen. Regards,

      priyank

      P Offline
      P Offline
      pri_skit
      wrote on last edited by
      #2

      How to start timer on screen which is drawn continously?

      priyank

      1 Reply Last reply
      0
      • P pri_skit

        I am drawing a screen which requires refrehing,so Invalidate() function is called continously.Now I want to start a timer when screen is drawn first time.In the timer i want to call another function which draws another screen after some time.How this could be done? I have tried to start timer but it starts only after when i Maximize 0r minimize a screen. Regards,

        priyank

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        pri_skit wrote:

        I want to start a timer when screen is drawn first time

        // add a member variable
        UINT_PTR m_TimerID;

        ...

        // initialize in constructor
        m_TimerID = 0;

        ...

        void OnPaint()
        {
           ...do some painting...

        if (0 == m_TimerID)
           {
              m_TimerID = SetTimer(...);
           }
        }

        Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        1 Reply Last reply
        0
        • P pri_skit

          I am drawing a screen which requires refrehing,so Invalidate() function is called continously.Now I want to start a timer when screen is drawn first time.In the timer i want to call another function which draws another screen after some time.How this could be done? I have tried to start timer but it starts only after when i Maximize 0r minimize a screen. Regards,

          priyank

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          And see Timers tutorial[^].

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups