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. witch message?

witch message?

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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.
  • W Offline
    W Offline
    willempipi
    wrote on last edited by
    #1

    hi, I want to start a procedure wenn my dialog has been drawn and initialiezed. Witch Windows Message Handler do i have to use? greetz willem

    J 1 Reply Last reply
    0
    • W willempipi

      hi, I want to start a procedure wenn my dialog has been drawn and initialiezed. Witch Windows Message Handler do i have to use? greetz willem

      J Offline
      J Offline
      Johnny
      wrote on last edited by
      #2

      OnInitDialog/WM_INITDIALOG

      W 1 Reply Last reply
      0
      • J Johnny

        OnInitDialog/WM_INITDIALOG

        W Offline
        W Offline
        willempipi
        wrote on last edited by
        #3

        no it doesn't work; BOOL CImportProcessDlg::OnInitDialog() { CDialog::OnInitDialog(); for (long i = 1; i < 100000; i++) { m_Tekst.Format("%d", i); UpdateData(FALSE); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } if i run this the dialog just waits till i = 1000000 and then it pop's up... :S

        R 1 Reply Last reply
        0
        • W willempipi

          no it doesn't work; BOOL CImportProcessDlg::OnInitDialog() { CDialog::OnInitDialog(); for (long i = 1; i < 100000; i++) { m_Tekst.Format("%d", i); UpdateData(FALSE); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } if i run this the dialog just waits till i = 1000000 and then it pop's up... :S

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          Try this:

          1. Add a hidden button to your dialog, with id ID_RUN_LOOP.
          2. Write a handler for the ID_RUN_LOOP command. The handler should execute the for loop.
          3. In your dialog's OnInitDialog() handler, do this: PostMessage (WM_COMMAND, ID_RUN_LOOP);

          This should cause the loop to be executed after your dialog has been initialized and shown on the screen. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

          M 1 Reply Last reply
          0
          • R Ravi Bhavnani

            Try this:

            1. Add a hidden button to your dialog, with id ID_RUN_LOOP.
            2. Write a handler for the ID_RUN_LOOP command. The handler should execute the for loop.
            3. In your dialog's OnInitDialog() handler, do this: PostMessage (WM_COMMAND, ID_RUN_LOOP);

            This should cause the loop to be executed after your dialog has been initialized and shown on the screen. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

            M Offline
            M Offline
            melwyn
            wrote on last edited by
            #5

            Another way is to use Timers. 1. Create a timer in OnInitDialog() 2. In the timer function do the for loop and then destroy the timer.

            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